当前位置: 首页>>代码示例>>Python>>正文


Python Environment.get_default_catalog_name方法代码示例

本文整理汇总了Python中pyvcloud.system_test_framework.environment.Environment.get_default_catalog_name方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.get_default_catalog_name方法的具体用法?Python Environment.get_default_catalog_name怎么用?Python Environment.get_default_catalog_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyvcloud.system_test_framework.environment.Environment的用法示例。


在下文中一共展示了Environment.get_default_catalog_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_0010_vm_setup

# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_default_catalog_name [as 别名]
    def test_0010_vm_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()
        TestPVDC._org_client = Environment.get_client_in_default_org(
            TestPVDC._test_runner_role)
        vdc = Environment.get_test_vdc(TestPVDC._org_client)

        logger.debug('Creating vApp ' + TestPVDC._test_vapp_name + '.')
        TestPVDC._test_vapp_href = create_customized_vapp_from_template(
            client=TestPVDC._org_client,
            vdc=vdc,
            name=TestPVDC._test_vapp_name,
            catalog_name=Environment.get_default_catalog_name(),
            template_name=Environment.get_default_template_name(),
            memory_size=TestPVDC._test_vapp_first_vm_memory_size,
            num_cpu=TestPVDC._test_vapp_first_vm_num_cpu,
            disk_size=TestPVDC._test_vapp_first_vm_first_disk_size,
            vm_name=TestPVDC._test_vapp_first_vm_name,
            nw_adapter_type=TestPVDC._test_vapp_first_vm_network_adapter_type)

        self.assertIsNotNone(TestPVDC._test_vapp_href)

        vapp = VApp(TestPVDC._org_client, href=TestPVDC._test_vapp_href)
        vm_resource = vapp.get_vm(TestPVDC._test_vapp_first_vm_name)
        TestPVDC._test_vapp_first_vm_href = vm_resource.get('href')

        self.assertIsNotNone(TestPVDC._test_vapp_first_vm_href)
开发者ID:vmware,项目名称:pyvcloud,代码行数:34,代码来源:pvdc_tests.py

示例2: test_0000_setup

# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_default_catalog_name [as 别名]
    def test_0000_setup(self):
        """Setup the vApps required for the other tests in this module.

        Create two vApps as per the configuration stated above.

        This test passes if the two vApp hrefs are not None.
        """
        logger = Environment.get_default_logger()
        TestVApp._client = Environment.get_client_in_default_org(
            TestVApp._test_runner_role)
        TestVApp._sys_admin_client = Environment.get_sys_admin_client()
        vdc = Environment.get_test_vdc(TestVApp._client)

        logger.debug('Creating empty vApp.')
        TestVApp._empty_vapp_href = \
            create_empty_vapp(client=TestVApp._client,
                              vdc=vdc,
                              name=TestVApp._empty_vapp_name,
                              description=TestVApp._empty_vapp_description)
        TestVApp._empty_vapp_owner_name = Environment.\
            get_username_for_role_in_test_org(TestVApp._test_runner_role)

        logger.debug('Creating customized vApp.')
        TestVApp._customized_vapp_href = create_customized_vapp_from_template(
            client=TestVApp._client,
            vdc=vdc,
            name=TestVApp._customized_vapp_name,
            catalog_name=Environment.get_default_catalog_name(),
            template_name=Environment.get_default_template_name(),
            description=TestVApp._customized_vapp_description,
            memory_size=TestVApp._customized_vapp_memory_size,
            num_cpu=TestVApp._customized_vapp_num_cpu,
            disk_size=TestVApp._customized_vapp_disk_size,
            vm_name=TestVApp._customized_vapp_vm_name,
            vm_hostname=TestVApp._customized_vapp_vm_hostname,
            nw_adapter_type=TestVApp._customized_vapp_vm_network_adapter_type)
        TestVApp._customized_vapp_owner_name = Environment.\
            get_username_for_role_in_test_org(TestVApp._test_runner_role)

        self.assertIsNotNone(TestVApp._empty_vapp_href)
        self.assertIsNotNone(TestVApp._customized_vapp_href)
开发者ID:vmware,项目名称:pyvcloud,代码行数:43,代码来源:vapp_tests.py


注:本文中的pyvcloud.system_test_framework.environment.Environment.get_default_catalog_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。