def test_case_create(self): thread = self._start_server() client = EngineClient(thread.server._transport) account_uuid = str(uuid.uuid4()) result = client.case_create(account_uuid=account_uuid, name='testname') self.assertValidId(result) result2 = client.case_get(result['uuid']) self._stop_server(client, thread) self.assertEquals(result2['uuid'], result['uuid']) self.assertEquals(result2['name'], 'testname')
def test_case_list(self): thread = self._start_server() client = EngineClient(thread.server._transport) account_uuid = str(uuid.uuid4()) one = client.case_create(account_uuid=account_uuid, name='one') two = client.case_create(account_uuid=account_uuid, name='two') self.assertValidId(one) self.assertValidId(two) items = client.case_list(account_uuid) self._stop_server(client, thread) found = 0 for item in items: if item['uuid'] == one['uuid']: found += 1 self.assertEquals(item['name'], 'one') elif item['uuid'] == two['uuid']: found += 1 self.assertEquals(item['name'], 'two') self.assertEquals(found, 2)