Exemplo n.º 1
0
 def test_setConnect(self):
     """
     You can tell the connection pool how to make connections.
     """
     called = []
     def mkConnection(arg):
         called.append(arg)
         return 'connection'
     pool = ConnectionPool()
     pool.setConnect(mkConnection, 'foo')
     d = pool.makeConnection()
     self.assertEqual(self.successResultOf(d), 'connection')
     self.assertEqual(called, ['foo'])