本文整理汇总了Python中charlatan.FixturesManager.uninstall_fixtures方法的典型用法代码示例。如果您正苦于以下问题:Python FixturesManager.uninstall_fixtures方法的具体用法?Python FixturesManager.uninstall_fixtures怎么用?Python FixturesManager.uninstall_fixtures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charlatan.FixturesManager
的用法示例。
在下文中一共展示了FixturesManager.uninstall_fixtures方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_uninstall_fixture
# 需要导入模块: from charlatan import FixturesManager [as 别名]
# 或者: from charlatan.FixturesManager import uninstall_fixtures [as 别名]
def test_uninstall_fixture(self):
manager = FixturesManager()
manager.load(
'./charlatan/tests/data/relationships_without_models.yaml')
manager.install_fixture('simple_dict')
manager.uninstall_fixture('simple_dict')
# verify we are forgiving with list inputs
manager.install_fixtures('simple_dict')
manager.uninstall_fixtures('simple_dict')
示例2: test_uninstall_fixtures
# 需要导入模块: from charlatan import FixturesManager [as 别名]
# 或者: from charlatan.FixturesManager import uninstall_fixtures [as 别名]
def test_uninstall_fixtures(self):
"""uninstall_fixtures should return the list of installed fixtures."""
fixtures_manager = FixturesManager()
fixtures_manager.load(
'./charlatan/tests/data/relationships_without_models.yaml')
fixture_keys = ('simple_dict', 'dict_with_nest')
fixtures_manager.install_fixtures(fixture_keys)
self.assertEqual(len(fixtures_manager.cache.keys()), 2)
fixtures = fixtures_manager.uninstall_fixtures(fixture_keys)
self.assertEqual(len(fixtures), 2)
self.assertEqual(len(fixtures_manager.cache.keys()), 0)
# uninstalling non-exiting fixtures should not raise an exception
fixtures = fixtures_manager.uninstall_fixtures(fixture_keys)
self.assertEqual(len(fixtures), 0)
self.assertEqual(len(fixtures_manager.cache.keys()), 0)
示例3: test_uninstall_fixture
# 需要导入模块: from charlatan import FixturesManager [as 别名]
# 或者: from charlatan.FixturesManager import uninstall_fixtures [as 别名]
def test_uninstall_fixture(self):
"""uninstall_fixture should return the fixture."""
fixtures_manager = FixturesManager()
fixtures_manager.load(
'./charlatan/tests/data/relationships_without_models.yaml')
fixtures_manager.install_fixture('simple_dict')
fixture = fixtures_manager.uninstall_fixture('simple_dict')
self.assertEqual(fixture, {
'field1': 'lolin',
'field2': 2,
})
# verify we are forgiving with list inputs
fixtures = fixtures_manager.install_fixtures('simple_dict')
self.assertEqual(len(fixtures), 1)
fixtures = fixtures_manager.uninstall_fixtures('simple_dict')
self.assertEqual(len(fixtures), 1)
self.assertEqual(fixtures[0], {
'field1': 'lolin',
'field2': 2,
})