예제 #1
0
파일: test_engine.py 프로젝트: vindeka/gate
    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')
예제 #2
0
    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')
예제 #3
0
파일: test_engine.py 프로젝트: vindeka/gate
    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)
예제 #4
0
    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)