def test_cached_global_pool(self): pool1 = default_pool(self.reactor, None, None) self.HTTPConnectionPool.return_value = mock.Mock() pool2 = default_pool(self.reactor, None, True) self.assertEqual(pool1, pool2)
def test_specified_pool(self): pool = mock.Mock() self.assertEqual( default_pool(self.reactor, pool, None), pool ) self.HTTPConnectionPool.assert_not_called()
def test_pool_none_persistent_true(self): self.assertEqual( default_pool(self.reactor, None, True), self.HTTPConnectionPool.return_value ) self.HTTPConnectionPool.assert_called_once_with( self.reactor, persistent=True )