本文整理汇总了Python中paasta_tools.cli.utils.PaastaCheckMessages.service_dir_missing方法的典型用法代码示例。如果您正苦于以下问题:Python PaastaCheckMessages.service_dir_missing方法的具体用法?Python PaastaCheckMessages.service_dir_missing怎么用?Python PaastaCheckMessages.service_dir_missing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paasta_tools.cli.utils.PaastaCheckMessages
的用法示例。
在下文中一共展示了PaastaCheckMessages.service_dir_missing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: service_dir_check
# 需要导入模块: from paasta_tools.cli.utils import PaastaCheckMessages [as 别名]
# 或者: from paasta_tools.cli.utils.PaastaCheckMessages import service_dir_missing [as 别名]
def service_dir_check(service, soa_dir):
"""Check whether directory service exists in /nail/etc/services
:param service: string of service name we wish to inspect
"""
try:
validate_service_name(service, soa_dir)
print PaastaCheckMessages.service_dir_found(service, soa_dir)
except NoSuchService:
print PaastaCheckMessages.service_dir_missing(service, soa_dir)
示例2: test_check_service_dir_check_fail
# 需要导入模块: from paasta_tools.cli.utils import PaastaCheckMessages [as 别名]
# 或者: from paasta_tools.cli.utils.PaastaCheckMessages import service_dir_missing [as 别名]
def test_check_service_dir_check_fail(mock_stdout, mock_validate_service_name):
service = 'fake_service'
mock_validate_service_name.side_effect = NoSuchService(service)
expected_output = "%s\n" \
% PaastaCheckMessages.service_dir_missing(service)
service_dir_check(service)
output = mock_stdout.getvalue()
assert output == expected_output