def test_rpc_get_request_multiple_2(self):
        rpc = Rpc(FakeConnection())
        uuid = rpc.register_request(['Test'])
        for index in range(1000):
            rpc.on_frame(FakePayload(name='Test', value=index))
            result = rpc.get_request(uuid=uuid, raw=True, multiple=True)
            self.assertEqual(result.value, index)

        rpc.remove(uuid)
Exemple #2
0
    def test_rpc_get_request_multiple_2(self):
        rpc = Rpc(FakeConnection())
        uuid = rpc.register_request(['travis-ci'])
        for index in range(1000):
            rpc.on_frame(FakePayload(name='travis-ci', value=index))
            result = rpc.get_request(uuid=uuid, raw=True, multiple=True)
            self.assertEqual(result.value, index)

        rpc.remove(uuid)
 def test_rpc_remove_multiple(self):
     rpc = Rpc(FakeConnection())
     uuid = rpc.register_request(['Test'])
     for index in range(1000):
         rpc.on_frame(FakePayload(name='Test', value=index))
     self.assertEqual(len(rpc._request), 1)
     self.assertEqual(len(rpc._response[uuid]), 1000)
     rpc.remove(uuid)
     self.assertEqual(len(rpc._request), 0)
     self.assertEqual(len(rpc._response), 0)
 def test_rpc_remove(self):
     rpc = Rpc(FakeConnection())
     uuid = rpc.register_request(['Test'])
     self.assertEqual(len(rpc._request), 1)
     self.assertEqual(len(rpc._response), 1)
     self.assertEqual(len(rpc._response[uuid]), 0)
     rpc.on_frame(FakePayload(name='Test'))
     rpc.remove(uuid)
     self.assertEqual(len(rpc._request), 0)
     self.assertEqual(len(rpc._response), 0)
Exemple #5
0
 def test_rpc_remove(self):
     rpc = Rpc(FakeConnection())
     uuid = rpc.register_request(['travis-ci'])
     self.assertEqual(len(rpc._request), 1)
     self.assertEqual(len(rpc._response), 1)
     self.assertEqual(len(rpc._response[uuid]), 0)
     rpc.on_frame(FakePayload(name='travis-ci'))
     rpc.remove(uuid)
     self.assertEqual(len(rpc._request), 0)
     self.assertEqual(len(rpc._response), 0)
Exemple #6
0
 def test_rpc_remove_multiple(self):
     rpc = Rpc(FakeConnection())
     uuid = rpc.register_request(['travis-ci'])
     for index in range(1000):
         rpc.on_frame(FakePayload(name='travis-ci', value=index))
     self.assertEqual(len(rpc._request), 1)
     self.assertEqual(len(rpc._response[uuid]), 1000)
     rpc.remove(uuid)
     self.assertEqual(len(rpc._request), 0)
     self.assertEqual(len(rpc._response), 0)