def test_create_with_kerberos_auth(self, ODCS): odcs = create_odcs_client() self.assertEqual(ODCS.return_value, odcs) ODCS.assert_called_once_with(conf.odcs_server_url, auth_mech=AuthMech.Kerberos, verify_ssl=conf.odcs_verify_ssl)
def test_create_with_openidc_auth(self, ODCS): odcs = create_odcs_client() self.assertEqual(ODCS.return_value, odcs) ODCS.assert_called_once_with(conf.odcs_server_url, auth_mech=AuthMech.OpenIDC, openidc_token='12345', verify_ssl=conf.odcs_verify_ssl)
def odcs_get_compose(self, compose_id): """ Returns the information from the ODCS server about compose with id `compose_id`. In DRY_RUN mode, returns fake compose information without contacting the ODCS server. """ if self.dry_run: return { 'id': compose_id, 'result_repofile': "http://localhost/%d.repo" % compose_id, 'state': COMPOSE_STATES['done'], } return create_odcs_client().get_compose(compose_id)
def finished(self): from freshmaker.odcsclient import create_odcs_client return 'done' == create_odcs_client().get_compose( self.odcs_compose_id)['state_name']