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


Python MyService.service_power方法代码示例

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


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

示例1: test_service_start

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import service_power [as 别名]
def test_service_start(appliance, setup_provider, context,
                       order_service, provider, request):
    """Test service stop

    Metadata:
        test_flag: ssui, services
    """
    catalog_item = order_service
    with appliance.context.use(context):
        my_service = MyService(appliance, catalog_item.name)
        if provider.one_of(InfraProvider, EC2Provider, AzureProvider):
            # For Infra providers vm is provisioned.Hence Stop option is shown
            # For Azure, EC2 Providers Instance is provisioned.Hence Stop option is shown
            my_service.service_power(power='Stop')
            view = my_service.create_view(DetailsMyServiceView)
            wait_for(lambda: view.resource_power_status.power_status == 'Off',
                     timeout=1000,
                     fail_condition=None,
                     message='Wait for resources off',
                     delay=20)
        else:
            my_service.service_power(power='Start')
            view = my_service.create_view(DetailsMyServiceView)
            wait_for(lambda: view.resource_power_status.power_status == 'On',
                     timeout=1000,
                     fail_condition=None,
                     message='Wait for resources on',
                     delay=20)

        @request.addfinalizer
        def _finalize():
            my_service.delete()
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:34,代码来源:test_ssui_myservice.py

示例2: test_service_start

# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import service_power [as 别名]
def test_service_start(appliance, setup_provider, context,
                       order_service, provider, request):
    """Test service stop"""
    catalog_item = order_service
    with appliance.context.use(context):
        my_service = MyService(appliance, catalog_item.name)
        if provider.one_of(InfraProvider):
            # For Infra providers vm is provisioned.Hence Stop option is shown
            my_service.service_power(power='Stop')
            view = my_service.create_view(DetailsMyServiceView)
            view.notification.assert_message(
                "{} was {}.".format(catalog_item.name, 'stopped'))
        else:
            my_service.service_power(power='Start')
            view = my_service.create_view(DetailsMyServiceView)
            view.notification.assert_message(
                "{} was {}.".format(catalog_item.name, 'started'))

        @request.addfinalizer
        def _finalize():
            my_service.delete()
开发者ID:LandoCalrizzian,项目名称:cfme_tests,代码行数:23,代码来源:test_ssui_myservice.py


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