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


Python Environment.get_testsets方法代码示例

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


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

示例1: check

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import get_testsets [as 别名]
    def check(self, params):
        """To run some health checks:
                fuel --env 1 health --check smoke,sanity
        """
        env = Environment(params.env)

        if env.status not in self._allowed_statuses and not params.force:
            exit_with_error(
                "Environment is not ready to run health check "
                "because it is in {0} state. "
                "Health check is likely to fail because of "
                "this. Use --force flag to proceed anyway.". format(env.status)
            )

        if env.is_customized and not params.force:
            exit_with_error(
                "Environment deployment facts were updated. "
                "Health check is likely to fail because of "
                "that. Use --force flag to proceed anyway."
            )
        test_sets_to_check = params.check or set(
            ts["id"] for ts in env.get_testsets())
        env.run_test_sets(test_sets_to_check)
        tests_state = env.get_state_of_tests()
        self.serializer.print_to_output(
            tests_state,
            env,
            print_method=print_health_check
        )
开发者ID:Axam,项目名称:fuel-web,代码行数:31,代码来源:health.py

示例2: list

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import get_testsets [as 别名]
 def list(self, params):
     """To list all health check test sets:
             fuel --env 1 health
         or:
             fuel --env 1 health --list
     """
     env = Environment(params.env)
     test_sets = env.get_testsets()
     self.serializer.print_to_output(test_sets, format_table(test_sets))
开发者ID:tinyxiao,项目名称:python-fuelclient,代码行数:11,代码来源:health.py

示例3: check

# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import get_testsets [as 别名]
    def check(self, params):
        """To run some health checks:
                fuel --env 1 health --check smoke,sanity
        """
        env = Environment(params.env)

        if env.status not in self._allowed_statuses and not params.force:
            raise EnvironmentException(
                "Environment is not ready to run health check "
                "because it is in {0} state. "
                "Health check is likely to fail because of "
                "this. Use --force flag to proceed anyway.". format(env.status)
            )

        if env.is_customized and not params.force:
            raise EnvironmentException(
                "Environment deployment facts were updated. "
                "Health check is likely to fail because of "
                "that. Use --force flag to proceed anyway."
            )
        test_sets_to_check = params.check or set(
            ts["id"] for ts in env.get_testsets())
        ostf_credentials = {}
        if params.ostf_tenant_name is not None:
            ostf_credentials['tenant'] = params.ostf_tenant_name
        if params.ostf_username is not None:
            ostf_credentials['username'] = params.ostf_username
        if params.ostf_password is not None:
            ostf_credentials['password'] = params.ostf_password
        if not ostf_credentials:
            six.print_("WARNING: ostf credentials are going to be",
                       "mandatory in the next release.", file=sys.stderr)
        env.run_test_sets(test_sets_to_check, ostf_credentials)
        tests_state = env.get_state_of_tests()
        self.serializer.print_to_output(
            tests_state,
            env,
            print_method=print_health_check
        )
开发者ID:heartpandora,项目名称:python-fuelclient,代码行数:41,代码来源:health.py


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