def test_buildConnectionPool(self):
"""
L{buildConnectionPool} returns a L{ConnectionPool} which will be
running only for the duration of the test.
"""
collect = []
class SampleTest(TestCase):
def setUp(self):
self.pool = buildConnectionPool(self)
def test_sample(self):
collect.append(self.pool.running)
def tearDown(self):
collect.append(self.pool.running)
r = TestResult()
t = SampleTest("test_sample")
t.run(r)
self.assertIsInstance(t.pool, ConnectionPool)
self.assertEqual([True, False], collect)
评论列表
文章目录