本文整理匯總了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