本文整理汇总了Python中pyvcloud.system_test_framework.environment.Environment.get_test_media_resource方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.get_test_media_resource方法的具体用法?Python Environment.get_test_media_resource怎么用?Python Environment.get_test_media_resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.system_test_framework.environment.Environment
的用法示例。
在下文中一共展示了Environment.get_test_media_resource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_test_media_resource [as 别名]
def test_0000_setup(self):
"""Load configuration and create a click runner to invoke CLI."""
VmTest._config = Environment.get_config()
VmTest._logger = Environment.get_default_logger()
VmTest._client = Environment.get_client_in_default_org(
CommonRoles.ORGANIZATION_ADMINISTRATOR)
VmTest._media_resource = Environment.get_test_media_resource()
VmTest._runner = CliRunner()
default_org = VmTest._config['vcd']['default_org_name']
VmTest._login(self)
VmTest._runner.invoke(org, ['use', default_org])
VmTest._test_vdc = Environment.get_test_vdc(VmTest._client)
VmTest._test_vapp = Environment.get_test_vapp_with_network(
VmTest._client)
VmTest._test_vm = VM(
VmTest._client,
href=VmTest._test_vapp.get_vm(VAppConstants.vm1_name).get('href'))
示例2: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_test_media_resource [as 别名]
def test_0000_setup(self):
"""Setup the vms required for the other tests in this module.
Create a vApp with just one vm as per the configuration stated above.
This test passes if the vApp and vm hrefs are not None.
"""
logger = Environment.get_default_logger()
TestVM._client = Environment.get_client_in_default_org(
TestVM._test_runner_role)
TestVM._sys_admin_client = Environment.get_sys_admin_client()
vdc = Environment.get_test_vdc(TestVM._client)
TestVM._media_resource = Environment.get_test_media_resource()
logger.debug('Creating vApp ' + TestVM._test_vapp_name + '.')
TestVM._test_vapp_href = create_customized_vapp_from_template(
client=TestVM._client,
vdc=vdc,
name=TestVM._test_vapp_name,
catalog_name=Environment.get_default_catalog_name(),
template_name=Environment.get_default_template_name(),
memory_size=TestVM._test_vapp_first_vm_memory_size,
num_cpu=TestVM._test_vapp_first_vm_num_cpu,
disk_size=TestVM._test_vapp_first_vm_first_disk_size,
vm_name=TestVM._test_vapp_first_vm_name,
nw_adapter_type=TestVM._test_vapp_first_vm_network_adapter_type)
self.assertIsNotNone(TestVM._test_vapp_href)
vapp = VApp(TestVM._client, href=TestVM._test_vapp_href)
vm_resource = vapp.get_vm(TestVM._test_vapp_first_vm_name)
TestVM._test_vapp_first_vm_href = vm_resource.get('href')
self.assertIsNotNone(TestVM._test_vapp_first_vm_href)
logger.debug('Creating empty vApp.')
TestVM._empty_vapp_href = \
create_empty_vapp(client=TestVM._client,
vdc=vdc,
name=TestVM._empty_vapp_name,
description=TestVM._empty_vapp_description)
TestVM._empty_vapp_owner_name = Environment. \
get_username_for_role_in_test_org(TestVM._test_runner_role)