예제 #1
0
파일: check.py 프로젝트: ashwinaj/paasta
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)
예제 #2
0
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)
예제 #3
0
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
예제 #4
0
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