Exemple #1
0
 async def inner_test() -> None:
     async with TestServer(ip="::1") as sa:
         ip, port = sa.ip, sa.port
         assert ip and port
         async with get_client(TestingService, host=ip,
                               port=port) as client:
             self.assertEqual(True, await client.renamed_func(True))
Exemple #2
0
 async def inner_test() -> None:
     async with TestServer() as sa:
         ip, port = sa.ip, sa.port
         assert ip and port
         client = get_client(TestingService, host=ip, port=port)
         await client.__aenter__()
         self.assertTrue(await client.invert(False))
         self.assertFalse(await client.invert(True))
Exemple #3
0
 async def inner_test() -> None:
     async with TestServer() as sa:
         ip, port = sa.ip, sa.port
         assert ip and port
         client = get_client(TestingService, host=ip, port=port)
         await client.__aenter__()
         self.assertTrue(await client.invert(False))
         self.assertFalse(await client.invert(True))
         _ = client.__aexit__(None, None, None)
         del client  # If we do not abort here then good
Exemple #4
0
 async def inner_test() -> None:
     async with TestServer(ip="::1") as sa:
         ip, port = sa.ip, sa.port
         assert ip and port
         async with get_client(TestingService, host=ip,
                               port=port) as client:
             self.assertTrue(await client.invert(False))
             self.assertFalse(await client.invert(True))
             # TODO (ffrancet): after RPC headers are supported, check uex and uexw
             with self.assertRaises(SimpleError):
                 await client.takes_a_list([])
Exemple #5
0
 async def client_call(sa: SocketAddress) -> str:
     ip, port = sa.ip, sa.port
     assert ip and port
     async with get_client(DerivedTestingService, host=ip,
                           port=port) as client:
         try:
             return await client.getName()
         except ApplicationError as err:
             if "Queue Timeout" in str(err):
                 return "Queue Timeout"
             else:
                 return ""
Exemple #6
0
 async def inner_test() -> None:
     async with TestServer(handler=DerivedHandler()) as sa:
         ip, port = sa.ip, sa.port
         assert ip and port
         async with get_client(
                 DerivedTestingService,
                 host=ip,
                 port=port,
         ) as client:
             self.assertEqual(await client.getName(), "DerivedTesting")
             self.assertEqual(
                 await client.derived_pick_a_color(Color.red),
                 Color.red)
Exemple #7
0
 async def inner_test() -> None:
     async with TestServer() as sa:
         ip, port = sa.ip, sa.port
         assert ip and port
         get_client(TestingService, host=ip, port=port)