本文整理汇总了Python中tempest.cmd.verify_tempest_config.verify_extensions函数的典型用法代码示例。如果您正苦于以下问题:Python verify_extensions函数的具体用法?Python verify_extensions怎么用?Python verify_extensions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verify_extensions函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_verify_extensions_swift
def test_verify_extensions_swift(self):
def fake_list_extensions():
return {'fake1': 'metadata',
'fake2': 'metadata',
'not_fake': 'metadata',
'swift': 'metadata'}
fake_os = mock.MagicMock()
fake_client = mock.MagicMock()
fake_client.list_capabilities = fake_list_extensions
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_extension_client',
return_value=fake_client))
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['fake1', 'fake2', 'fake3'])))
results = verify_tempest_config.verify_extensions(fake_os, 'swift', {})
self.assertIn('swift', results)
self.assertIn('fake1', results['swift'])
self.assertTrue(results['swift']['fake1'])
self.assertIn('fake2', results['swift'])
self.assertTrue(results['swift']['fake2'])
self.assertIn('fake3', results['swift'])
self.assertFalse(results['swift']['fake3'])
self.assertIn('not_fake', results['swift'])
self.assertFalse(results['swift']['not_fake'])
开发者ID:masayukig,项目名称:tempest,代码行数:25,代码来源:test_verify_tempest_config.py
示例2: test_verify_extensions_cinder
def test_verify_extensions_cinder(self):
def fake_list_extensions():
return {'extensions': [{'alias': 'fake1'},
{'alias': 'fake2'},
{'alias': 'not_fake'}]}
fake_os = mock.MagicMock()
fake_client = mock.MagicMock()
fake_client.list_extensions = fake_list_extensions
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_extension_client',
return_value=fake_client))
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['fake1', 'fake2', 'fake3'])))
results = verify_tempest_config.verify_extensions(fake_os,
'cinder', {})
self.assertIn('cinder', results)
self.assertIn('fake1', results['cinder'])
self.assertTrue(results['cinder']['fake1'])
self.assertIn('fake2', results['cinder'])
self.assertTrue(results['cinder']['fake2'])
self.assertIn('fake3', results['cinder'])
self.assertFalse(results['cinder']['fake3'])
self.assertIn('not_fake', results['cinder'])
self.assertFalse(results['cinder']['not_fake'])
开发者ID:masayukig,项目名称:tempest,代码行数:26,代码来源:test_verify_tempest_config.py
示例3: test_verify_extensions_swift_all
def test_verify_extensions_swift_all(self):
def fake_list_extensions():
return (None, {"fake1": "metadata", "fake2": "metadata", "not_fake": "metadata", "swift": "metadata"})
fake_os = mock.MagicMock()
fake_os.account_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(verify_tempest_config, "get_enabled_extensions", return_value=(["all"])))
results = verify_tempest_config.verify_extensions(fake_os, "swift", {})
self.assertIn("swift", results)
self.assertIn("extensions", results["swift"])
self.assertEqual(sorted(["not_fake", "fake1", "fake2"]), sorted(results["swift"]["extensions"]))
开发者ID:waipeng,项目名称:tempest,代码行数:11,代码来源:test_verify_tempest_config.py
示例4: test_verify_extensions_nova_all
def test_verify_extensions_nova_all(self):
def fake_list_extensions():
return {"extensions": [{"alias": "fake1"}, {"alias": "fake2"}, {"alias": "not_fake"}]}
fake_os = mock.MagicMock()
fake_os.extensions_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(verify_tempest_config, "get_enabled_extensions", return_value=(["all"])))
results = verify_tempest_config.verify_extensions(fake_os, "nova", {})
self.assertIn("nova", results)
self.assertIn("extensions", results["nova"])
self.assertEqual(sorted(["fake1", "fake2", "not_fake"]), sorted(results["nova"]["extensions"]))
开发者ID:waipeng,项目名称:tempest,代码行数:11,代码来源:test_verify_tempest_config.py
示例5: test_verify_extensions_cinder_all
def test_verify_extensions_cinder_all(self):
def fake_list_extensions():
return {"extensions": [{"alias": "fake1"}, {"alias": "fake2"}, {"alias": "not_fake"}]}
fake_os = mock.MagicMock()
# NOTE (e0ne): mock both v1 and v2 APIs
fake_os.volumes_extension_client.list_extensions = fake_list_extensions
fake_os.volumes_v2_extension_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(verify_tempest_config, "get_enabled_extensions", return_value=(["all"])))
results = verify_tempest_config.verify_extensions(fake_os, "cinder", {})
self.assertIn("cinder", results)
self.assertIn("extensions", results["cinder"])
self.assertEqual(sorted(["fake1", "fake2", "not_fake"]), sorted(results["cinder"]["extensions"]))
开发者ID:waipeng,项目名称:tempest,代码行数:13,代码来源:test_verify_tempest_config.py
示例6: test_verify_extensions_nova_all
def test_verify_extensions_nova_all(self):
def fake_list_extensions():
return ({'extensions': [{'alias': 'fake1'},
{'alias': 'fake2'},
{'alias': 'not_fake'}]})
fake_os = mock.MagicMock()
fake_os.extensions_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['all'])))
results = verify_tempest_config.verify_extensions(fake_os,
'nova', {})
self.assertIn('nova', results)
self.assertIn('extensions', results['nova'])
self.assertEqual(sorted(['fake1', 'fake2', 'not_fake']),
sorted(results['nova']['extensions']))
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:16,代码来源:test_verify_tempest_config.py
示例7: test_verify_extensions_cinder_all
def test_verify_extensions_cinder_all(self):
def fake_list_extensions():
return (None, {'extensions': [{'name': 'fake1'},
{'name': 'fake2'},
{'name': 'not_fake'}]})
fake_os = mock.MagicMock()
fake_os.volumes_extension_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['all'])))
results = verify_tempest_config.verify_extensions(fake_os,
'cinder', {})
self.assertIn('cinder', results)
self.assertIn('extensions', results['cinder'])
self.assertEqual(['fake1', 'fake2', 'not_fake'],
results['cinder']['extensions'])
开发者ID:JasGit,项目名称:tempest,代码行数:16,代码来源:test_verify_tempest_config.py
示例8: test_verify_extensions_swift_all
def test_verify_extensions_swift_all(self):
def fake_list_extensions():
return (None, {'fake1': 'metadata',
'fake2': 'metadata',
'not_fake': 'metadata',
'swift': 'metadata'})
fake_os = mock.MagicMock()
fake_os.account_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['all'])))
results = verify_tempest_config.verify_extensions(fake_os,
'swift', {})
self.assertIn('swift', results)
self.assertIn('extensions', results['swift'])
self.assertEqual(sorted(['not_fake', 'fake1', 'fake2']),
sorted(results['swift']['extensions']))
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:17,代码来源:test_verify_tempest_config.py
示例9: test_verify_extensions_swift_none
def test_verify_extensions_swift_none(self):
def fake_list_extensions():
return {'swift': 'metadata'}
fake_os = mock.MagicMock()
fake_client = mock.MagicMock()
fake_client.list_capabilities = fake_list_extensions
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_extension_client',
return_value=fake_client))
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['all'])))
results = verify_tempest_config.verify_extensions(fake_os,
'swift', {})
self.assertIn('swift', results)
self.assertIn('extensions', results['swift'])
self.assertEqual([], results['swift']['extensions'])
开发者ID:masayukig,项目名称:tempest,代码行数:17,代码来源:test_verify_tempest_config.py
示例10: test_verify_extensions_nova_none
def test_verify_extensions_nova_none(self):
def fake_list_extensions():
return ({'extensions': []})
fake_os = mock.MagicMock()
fake_client = mock.MagicMock()
fake_client.list_extensions = fake_list_extensions
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_extension_client',
return_value=fake_client))
self.useFixture(fixtures.MockPatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['all'])))
results = verify_tempest_config.verify_extensions(fake_os,
'nova', {})
self.assertIn('nova', results)
self.assertIn('extensions', results['nova'])
self.assertEqual([], results['nova']['extensions'])
开发者ID:masayukig,项目名称:tempest,代码行数:17,代码来源:test_verify_tempest_config.py
示例11: test_verify_extensions_cinder_all
def test_verify_extensions_cinder_all(self):
def fake_list_extensions():
return {'extensions': [{'alias': 'fake1'},
{'alias': 'fake2'},
{'alias': 'not_fake'}]}
fake_os = mock.MagicMock()
# NOTE (e0ne): mock both v1 and v2 APIs
fake_os.volumes_extension_client.list_extensions = fake_list_extensions
fake_os.volumes_v2_extension_client.list_extensions = (
fake_list_extensions)
self.useFixture(mockpatch.PatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['all'])))
results = verify_tempest_config.verify_extensions(fake_os,
'cinder', {})
self.assertIn('cinder', results)
self.assertIn('extensions', results['cinder'])
self.assertEqual(sorted(['fake1', 'fake2', 'not_fake']),
sorted(results['cinder']['extensions']))
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:19,代码来源:test_verify_tempest_config.py
示例12: test_verify_extensions_nova
def test_verify_extensions_nova(self):
def fake_list_extensions():
return ([{'alias': 'fake1'}, {'alias': 'fake2'},
{'alias': 'not_fake'}])
fake_os = mock.MagicMock()
fake_os.extensions_client.list_extensions = fake_list_extensions
self.useFixture(mockpatch.PatchObject(
verify_tempest_config, 'get_enabled_extensions',
return_value=(['fake1', 'fake2', 'fake3'])))
results = verify_tempest_config.verify_extensions(fake_os,
'nova', {})
self.assertIn('nova', results)
self.assertIn('fake1', results['nova'])
self.assertTrue(results['nova']['fake1'])
self.assertIn('fake2', results['nova'])
self.assertTrue(results['nova']['fake2'])
self.assertIn('fake3', results['nova'])
self.assertFalse(results['nova']['fake3'])
self.assertIn('not_fake', results['nova'])
self.assertFalse(results['nova']['not_fake'])
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:20,代码来源:test_verify_tempest_config.py
示例13: test_verify_extensions_nova
def test_verify_extensions_nova(self):
def fake_list_extensions():
return [{"alias": "fake1"}, {"alias": "fake2"}, {"alias": "not_fake"}]
fake_os = mock.MagicMock()
fake_os.extensions_client.list_extensions = fake_list_extensions
self.useFixture(
mockpatch.PatchObject(
verify_tempest_config, "get_enabled_extensions", return_value=(["fake1", "fake2", "fake3"])
)
)
results = verify_tempest_config.verify_extensions(fake_os, "nova", {})
self.assertIn("nova", results)
self.assertIn("fake1", results["nova"])
self.assertTrue(results["nova"]["fake1"])
self.assertIn("fake2", results["nova"])
self.assertTrue(results["nova"]["fake2"])
self.assertIn("fake3", results["nova"])
self.assertFalse(results["nova"]["fake3"])
self.assertIn("not_fake", results["nova"])
self.assertFalse(results["nova"]["not_fake"])
开发者ID:waipeng,项目名称:tempest,代码行数:21,代码来源:test_verify_tempest_config.py
示例14: test_verify_extensions_cinder
def test_verify_extensions_cinder(self):
def fake_list_extensions():
return (None, {"extensions": [{"name": "fake1"}, {"name": "fake2"}, {"name": "not_fake"}]})
fake_os = mock.MagicMock()
fake_os.volumes_extension_client.list_extensions = fake_list_extensions
self.useFixture(
mockpatch.PatchObject(
verify_tempest_config, "get_enabled_extensions", return_value=(["fake1", "fake2", "fake3"])
)
)
results = verify_tempest_config.verify_extensions(fake_os, "cinder", {})
self.assertIn("cinder", results)
self.assertIn("fake1", results["cinder"])
self.assertTrue(results["cinder"]["fake1"])
self.assertIn("fake2", results["cinder"])
self.assertTrue(results["cinder"]["fake2"])
self.assertIn("fake3", results["cinder"])
self.assertFalse(results["cinder"]["fake3"])
self.assertIn("not_fake", results["cinder"])
self.assertFalse(results["cinder"]["not_fake"])
开发者ID:kbijon,项目名称:OpenStack-CVRM,代码行数:21,代码来源:test_verify_tempest_config.py
注:本文中的tempest.cmd.verify_tempest_config.verify_extensions函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论