本文整理汇总了Python中anyblok.blok.BlokManager.unload方法的典型用法代码示例。如果您正苦于以下问题:Python BlokManager.unload方法的具体用法?Python BlokManager.unload怎么用?Python BlokManager.unload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anyblok.blok.BlokManager
的用法示例。
在下文中一共展示了BlokManager.unload方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def tearDown(self):
""" Clear the registry, unload the blok manager and drop the database
"""
if self.registry:
self.registry.close()
RegistryManager.clear()
BlokManager.unload()
super(DBTestCase, self).tearDown()
示例2: tearDown
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def tearDown(self):
""" Clear the registry, unload the blok manager and drop the database
"""
registry = RegistryManager.get(Configuration.get('db_name'))
registry.close()
RegistryManager.clear()
BlokManager.unload()
clear_mappers()
self.__class__.dropdb()
super(TestBlok, self).tearDown()
示例3: test_start_function
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def test_start_function(self):
BlokManager.unload()
db_name = Configuration.get('db_name') or 'test_anyblok'
db_driver_name = Configuration.get('db_driver_name') or 'postgresql'
testargs = ['default', '--db-name', db_name, '--db-driver-name',
db_driver_name]
with patch.object(sys, 'argv', testargs):
registry = start('default')
self.assertIsNotNone(registry)
示例4: setUpClass
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def setUpClass(cls):
""" Intialialise the configuration manager """
super(DBTestCase, cls).setUpClass()
cls.init_configuration_manager()
if cls.createdb(keep_existing=True):
BlokManager.load(entry_points=('bloks', 'test_bloks'))
registry = cls.getRegistry()
registry.commit()
registry.close()
BlokManager.unload()
示例5: test_anyblok_core_loaded
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def test_anyblok_core_loaded(self):
BlokManager.load()
is_exist = 'anyblok-core' in RegistryManager.loaded_bloks
self.assertEqual(is_exist, True)
anyblokcore = RegistryManager.loaded_bloks['anyblok-core']
self.assertEqual(len(anyblokcore['Core']['Base']), 1)
self.assertEqual(len(anyblokcore['Core']['SqlBase']), 1)
self.assertEqual(len(anyblokcore['Core']['SqlViewBase']), 1)
self.assertEqual(len(anyblokcore['Core']['Session']), 1)
self.assertEqual(len(anyblokcore['Core']['Query']), 1)
self.assertEqual(len(anyblokcore['Core']['InstrumentedList']), 1)
is_exist = 'Model.System' in anyblokcore['Model']
self.assertEqual(is_exist, True)
BlokManager.unload()
示例6: tearDown
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def tearDown(self):
super(TestBlokManager, self).tearDown()
BlokManager.unload()
示例7: tearDownClass
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def tearDownClass(cls):
super(TestMigration, cls).tearDownClass()
BlokManager.unload()
RegistryManager.loaded_bloks = cls.loaded_bloks
cls.dropdb()
示例8: test_reload_blok
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import unload [as 别名]
def test_reload_blok(self):
BlokManager.load()
try:
RegistryManager.reload()
finally:
BlokManager.unload()