本文整理匯總了Python中libgiza.app.BuildApp.close_pool方法的典型用法代碼示例。如果您正苦於以下問題:Python BuildApp.close_pool方法的具體用法?Python BuildApp.close_pool怎麽用?Python BuildApp.close_pool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類libgiza.app.BuildApp
的用法示例。
在下文中一共展示了BuildApp.close_pool方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestBuildAppMinimalConfig
# 需要導入模塊: from libgiza.app import BuildApp [as 別名]
# 或者: from libgiza.app.BuildApp import close_pool [as 別名]
class TestBuildAppMinimalConfig(CommonAppSuite, TestCase):
@classmethod
def setUp(self):
self.app = BuildApp()
self.app.default_pool = random.choice(['serial', 'thread'])
self.app.pool_size = 2
self.c = None
def tearDown(self):
self.app.close_pool()
示例2: TestBuildAppStandardConfig
# 需要導入模塊: from libgiza.app import BuildApp [as 別名]
# 或者: from libgiza.app.BuildApp import close_pool [as 別名]
class TestBuildAppStandardConfig(CommonAppSuite, TestCase):
def setUp(self):
self.c = Configuration()
self.c.runstate = RuntimeStateConfig()
self.app = BuildApp(self.c)
self.app.default_pool = random.choice(['serial', 'thread'])
self.app.pool_size = 2
def test_conf_object_consistent_in_task(self):
self.assertEqual(self.app.queue, [])
t = self.app.add('task')
self.assertIs(self.c, t.conf)
self.assertIs(self.c, self.app.queue[0].conf)
def test_conf_object_consistent_in_app(self):
self.assertEqual(self.app.queue, [])
self.app.add('app')
self.assertIs(self.c, self.app.conf)
self.assertIs(self.c, self.app.queue[0].conf)
def test_conf_object_consistent_in_new_task(self):
self.assertEqual(self.app.queue, [])
t = Task()
self.assertIsNone(t.conf)
self.app.add(t)
self.assertIsNotNone(t.conf)
self.assertIs(self.c, self.app.queue[0].conf)
self.assertIs(self.c, t.conf)
def test_force_options(self):
self.assertEquals(self.c.runstate.force, self.app.force)
self.assertFalse(self.c.runstate.force)
self.assertFalse(self.app.force)
self.app._force = None
self.assertFalse(self.app.force)
def test_default_pool_size(self):
self.assertIsNotNone(self.c)
self.assertIsNotNone(self.app.conf)
self.app._pool_size = None
self.assertEquals(self.c.runstate.pool_size, self.app.pool_size)
def tearDown(self):
self.app.close_pool()