本文整理汇总了Python中tempest.cmd.verify_tempest_config.verify_glance_api_versions函数的典型用法代码示例。如果您正苦于以下问题:Python verify_glance_api_versions函数的具体用法?Python verify_glance_api_versions怎么用?Python verify_glance_api_versions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verify_glance_api_versions函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_verify_glance_version_no_v1
def test_verify_glance_version_no_v1(self):
def fake_get_versions():
return (None, ["v2.0"])
fake_os = mock.MagicMock()
fake_os.image_client.get_versions = fake_get_versions
with mock.patch.object(verify_tempest_config, "print_and_or_update") as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
print_mock.assert_called_once_with("api_v1", "image-feature-enabled", False, True)
开发者ID:waipeng,项目名称:tempest,代码行数:9,代码来源:test_verify_tempest_config.py
示例2: test_verify_glance_version_no_v2_with_v1_0
def test_verify_glance_version_no_v2_with_v1_0(self):
def fake_get_versions():
return (None, ['v1.0'])
fake_os = mock.MagicMock()
fake_os.image_client.get_versions = fake_get_versions
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
print_mock.assert_called_once_with('api_v2', 'image-feature-enabled',
False, True)
开发者ID:Tesora,项目名称:tesora-tempest,代码行数:10,代码来源:test_verify_tempest_config.py
示例3: test_verify_glance_version_no_v2_with_v1_0
def test_verify_glance_version_no_v2_with_v1_0(self):
# This test verifies that wrong config api_v2 = True is detected
class FakeClient(object):
def get_versions(self):
return (None, ['v1.0'])
fake_os = mock.MagicMock()
fake_module = mock.MagicMock()
fake_module.ImagesClient = FakeClient
fake_os.image_v1 = fake_module
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
print_mock.assert_called_once_with('api_v2', 'image-feature-enabled',
False, True)
开发者ID:masayukig,项目名称:tempest,代码行数:15,代码来源:test_verify_tempest_config.py
示例4: test_verify_glance_version_no_v1
def test_verify_glance_version_no_v1(self):
# This test verifies that wrong config api_v1 = True is detected
class FakeClient(object):
def get_versions(self):
raise lib_exc.NotFound()
def list_versions(self):
return {'versions': [{'id': 'v2.0'}]}
fake_os = mock.MagicMock()
fake_module = mock.MagicMock()
fake_module.ImagesClient = FakeClient
fake_module.VersionsClient = FakeClient
fake_os.image_v1 = fake_module
fake_os.image_v2 = fake_module
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
print_mock.assert_not_called()
开发者ID:openstack,项目名称:tempest,代码行数:19,代码来源:test_verify_tempest_config.py
示例5: test_verify_glance_version_no_version
def test_verify_glance_version_no_version(self):
# This test verifies that wrong config api_v1 = True is detected
class FakeClient(object):
def get_versions(self):
raise lib_exc.NotFound()
def list_versions(self):
raise lib_exc.NotFound()
fake_os = mock.MagicMock()
fake_module = mock.MagicMock()
fake_module.ImagesClient = FakeClient
fake_module.VersionsClient = FakeClient
fake_os.image_v1 = fake_module
fake_os.image_v2 = fake_module
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
print_mock.assert_called_once_with('glance',
'service-available',
False, True)
开发者ID:masayukig,项目名称:tempest,代码行数:21,代码来源:test_verify_tempest_config.py
注:本文中的tempest.cmd.verify_tempest_config.verify_glance_api_versions函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论