Esempio n. 1
0
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
Esempio n. 2
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
Esempio n. 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
Esempio n. 4
0
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
Esempio n. 5
0
def test_check_service_dir_check_pass(mock_validate_service_name, capfd):
    mock_validate_service_name.return_value = None
    service = "fake_service"
    soa_dir = "/fake_yelpsoa_configs"
    expected_output = "%s\n" % PaastaCheckMessages.service_dir_found(service, soa_dir)
    service_dir_check(service, soa_dir)

    output, _ = capfd.readouterr()
    assert output == expected_output
Esempio n. 6
0
def test_check_service_dir_check_fail(mock_validate_service_name, capfd):
    service = "fake_service"
    soa_dir = "/fake_yelpsoa_configs"
    mock_validate_service_name.side_effect = NoSuchService(service)
    expected_output = "%s\n" % PaastaCheckMessages.service_dir_missing(service, soa_dir)
    service_dir_check(service, soa_dir)

    output, _ = capfd.readouterr()
    assert output == expected_output
Esempio n. 7
0
def test_check_service_dir_check_pass(mock_stdout, mock_validate_service_name):
    mock_validate_service_name.return_value = None
    service = 'fake_service'
    soa_dir = '/fake_yelpsoa_configs'
    expected_output = \
        "%s\n" % PaastaCheckMessages.service_dir_found(service, soa_dir)
    service_dir_check(service, soa_dir)
    output = mock_stdout.getvalue().decode('utf-8')

    assert output == expected_output
Esempio n. 8
0
def test_check_service_dir_check_fail(mock_stdout, mock_validate_service_name):
    service = 'fake_service'
    soa_dir = '/fake_yelpsoa_configs'
    mock_validate_service_name.side_effect = NoSuchService(service)
    expected_output = "%s\n" \
                      % PaastaCheckMessages.service_dir_missing(service, soa_dir)
    service_dir_check(service, soa_dir)
    output = mock_stdout.getvalue().decode('utf-8')

    assert output == expected_output