def service_dir_check(service): """Check whether directory service exists in /nail/etc/services :param service: string of service name we wish to inspect """ try: validate_service_name(service) print PaastaCheckMessages.service_dir_found(service) except NoSuchService: print PaastaCheckMessages.service_dir_missing(service)
def service_dir_check(service): """Check whether directory service exists in /nail/etc/services :param service: string of service name we wish to inspect """ try: validate_service_name(service) print PaastaCheckMessages.service_dir_found(service) except NoSuchService: print PaastaCheckMessages.service_dir_missing(service)
def test_check_service_dir_check_pass(mock_stdout, mock_validate_service_name): mock_validate_service_name.return_value = None service = 'fake_service' expected_output = \ "%s\n" % PaastaCheckMessages.service_dir_found(service) service_dir_check(service) output = mock_stdout.getvalue() assert output == expected_output
def test_check_service_dir_check_pass(mock_stdout, mock_validate_service_name): mock_validate_service_name.return_value = None service = 'fake_service' expected_output = \ "%s\n" % PaastaCheckMessages.service_dir_found(service) service_dir_check(service) output = mock_stdout.getvalue() assert output == expected_output