async def setUp(self):
     self.daemon = await tcp_daemon().open()
     self.client = tcp_client().open()
     self.api = RemoteAPI(self.client)
Ejemplo n.º 2
0
 async def test_tcp_connection(self):
     async with tcp_daemon() as daemon:
         with tcp_client(daemon.host) as client:
             async with client.get('/') as res:
                 self.assertEqual(res.status, 404)
Ejemplo n.º 3
0
 def test_closed(self):
     client = tcp_client()
     self.assertTrue(client.is_closed())
     with client:
         pass
     self.assertTrue(client.is_closed())
Ejemplo n.º 4
0
 def test_closed_request(self):
     client = tcp_client()
     with self.assertRaises(ClientError):
         client.get('/')
Ejemplo n.º 5
0
 def test_open(self):
     client = tcp_client()
     with client:
         self.assertFalse(client.is_closed())