Ejemplo n.º 1
0
 async def test_close_closes_active_connections(self):
     connector = self.new_connector()
     address = aioppspp.connection.Address('0.0.0.0', 0)
     connections = []
     for _ in range(3):
         connection = await connector.connect(address)
         connection.protocol.connection_made(unittest.mock.Mock())
         connections.append(connection)
     connector.close()
     for connection in connections:
         self.assertTrue(connection.closed)
Ejemplo n.º 2
0
 async def test_close_closes_active_connections(self):
     connector = self.new_connector()
     address = aioppspp.connection.Address('0.0.0.0', 0)
     connections = []
     for _ in range(3):
         connection = await connector.connect(address)
         connection.protocol.connection_made(unittest.mock.Mock())
         connections.append(connection)
     connector.close()
     for connection in connections:
         self.assertTrue(connection.closed)
Ejemplo n.º 3
0
 async def test_release(self):
     connector = self.new_connector()
     address = aioppspp.connection.Address('0.0.0.0', 0)
     connection0 = await connector.connect(address)
     connection1 = await connector.connect(address)
     connection0.protocol.connection_made(unittest.mock.Mock())
     connection1.protocol.connection_made(unittest.mock.Mock())
     connection0.release()
     connection1.release()
     await connector.connect(address)
     await connector.connect(address)
     connector.close()
Ejemplo n.º 4
0
 async def test_release(self):
     connector = self.new_connector()
     address = aioppspp.connection.Address('0.0.0.0', 0)
     connection0 = await connector.connect(address)
     connection1 = await connector.connect(address)
     connection0.protocol.connection_made(unittest.mock.Mock())
     connection1.protocol.connection_made(unittest.mock.Mock())
     connection0.release()
     connection1.release()
     await connector.connect(address)
     await connector.connect(address)
     connector.close()
Ejemplo n.º 5
0
 def test_release_connection_while_closed(self):
     connector = self.new_connector()
     connector.close()
     connector.release_connection(...)
Ejemplo n.º 6
0
 async def test_close_connection_when_closed(self):
     connector = self.new_connector()
     address = aioppspp.connection.Address('0.0.0.0', 0)
     connection = await connector.connect(address)
     connector.close()
     connector.close_connection(connection)
Ejemplo n.º 7
0
 def test_close_closed_connector(self):
     connector = self.new_connector()
     connector.close()
     connector.close()
Ejemplo n.º 8
0
 def test_close(self):
     connector = self.new_connector()
     connector.close()
     self.assertTrue(connector.closed)
Ejemplo n.º 9
0
 def test_release_connection_while_closed(self):
     connector = self.new_connector()
     connector.close()
     connector.release_connection(...)
Ejemplo n.º 10
0
 async def test_close_connection_when_closed(self):
     connector = self.new_connector()
     address = aioppspp.connection.Address('0.0.0.0', 0)
     connection = await connector.connect(address)
     connector.close()
     connector.close_connection(connection)
Ejemplo n.º 11
0
 def test_close_closed_connector(self):
     connector = self.new_connector()
     connector.close()
     connector.close()
Ejemplo n.º 12
0
 def test_close(self):
     connector = self.new_connector()
     connector.close()
     self.assertTrue(connector.closed)