Пример #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)
Пример #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)
Пример #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()
Пример #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()
Пример #5
0
 def test_release_connection_while_closed(self):
     connector = self.new_connector()
     connector.close()
     connector.release_connection(...)
Пример #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)
Пример #7
0
 def test_close_closed_connector(self):
     connector = self.new_connector()
     connector.close()
     connector.close()
Пример #8
0
 def test_close(self):
     connector = self.new_connector()
     connector.close()
     self.assertTrue(connector.closed)
Пример #9
0
 def test_release_connection_while_closed(self):
     connector = self.new_connector()
     connector.close()
     connector.release_connection(...)
Пример #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)
Пример #11
0
 def test_close_closed_connector(self):
     connector = self.new_connector()
     connector.close()
     connector.close()
Пример #12
0
 def test_close(self):
     connector = self.new_connector()
     connector.close()
     self.assertTrue(connector.closed)