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


Python PaastaCheckMessages.sensu_team_found方法代码示例

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


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

示例1: sensu_check

# 需要导入模块: from paasta_tools.cli.utils import PaastaCheckMessages [as 别名]
# 或者: from paasta_tools.cli.utils.PaastaCheckMessages import sensu_team_found [as 别名]
def sensu_check(service, service_path, soa_dir):
    """Check whether monitoring.yaml exists in service directory,
    and that the team name is declared.

    :param service: name of service currently being examined
    :param service_path: path to loction of monitoring.yaml file"""
    if is_file_in_dir('monitoring.yaml', service_path):
        print PaastaCheckMessages.SENSU_MONITORING_FOUND
        team = get_team(service=service, overrides={}, soa_dir=soa_dir)
        if team is None:
            print PaastaCheckMessages.SENSU_TEAM_MISSING
        else:
            print PaastaCheckMessages.sensu_team_found(team)
    else:
        print PaastaCheckMessages.SENSU_MONITORING_MISSING
开发者ID:seco,项目名称:paasta,代码行数:17,代码来源:check.py

示例2: test_check_sensu_check_pass

# 需要导入模块: from paasta_tools.cli.utils import PaastaCheckMessages [as 别名]
# 或者: from paasta_tools.cli.utils.PaastaCheckMessages import sensu_team_found [as 别名]
def test_check_sensu_check_pass(mock_stdout, mock_get_team,
                                mock_is_file_in_dir):
    # monitoring.yaml exists and team is found

    mock_is_file_in_dir.return_value = "/fake/path"
    team = 'team-service-infra'
    mock_get_team.return_value = team
    expected_output = "%s\n%s\n" % (PaastaCheckMessages.SENSU_MONITORING_FOUND,
                                    PaastaCheckMessages.sensu_team_found(team))

    sensu_check('fake_service', 'path')
    output = mock_stdout.getvalue()

    assert output == expected_output
    mock_get_team.assert_called_once_with(service='fake_service', overrides={})
开发者ID:iomedhealth,项目名称:paasta,代码行数:17,代码来源:test_cmds_check.py


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