def test_applications_POST_apikey_is_set(self): self.req.swagger_data = {'application': Application(name='App 3')} httpApps = Applications(self.req) response = httpApps.applications_POST() expected = Application.get_by('name', 'App 3').as_dict() assert expected['apikey'] is not None
def test_applications_POST(self): self.req.swagger_data = {'application': Application(name='App 3')} httpApps = Applications(self.req) response = httpApps.applications_POST() expected = Application.get_by('name', 'App 3').as_dict() assert response == expected
def test_can_set_apikey(self): apikey = str(uuid.uuid4()) app = Application(name='App with UUID', apikey=str(uuid.uuid4())) app = Application.save(app) expected = Application.get_by('apikey', apikey) assert expected == app
def test_experimentdistribution_can_be_set(self): app = Application(name='Banana', experiment_distribution='one_random') try: Application.save(app) except Exception as e: pass assert Application.get_by('name', 'Banana') is not None
def test_experimentdistribution_exists(self): experiment_distribution_exists = False app = Application(name='Banana') Application.save(app) app = Application.get_by('name', 'Banana') try: experiment_distribution = app.experiment_distribution experiment_distribution_exists = True except Exception as e: pass assert experiment_distribution_exists
def test_applications_PUT(self): expected_name = 'Veri specil' self.req.swagger_data = {'application': Application(name=expected_name)} httpApps = Applications(self.req) httpApps.applications_POST() app = Application.get_by('name', expected_name) apikey = app.apikey id = app.id self.req.swagger_data = {'id': app.id, 'application': Application(name='', apikey=apikey, id=id)} httpApps.applications_PUT() name_now = Application.get(id).name assert name_now == expected_name