本文整理汇总了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()