Beispiel #1
0
def test_check_yaml_check_fail(mock_stdout, mock_is_file_in_dir):
    # marathon.yaml exists and is valid

    mock_is_file_in_dir.return_value = False
    expected_output = "%s\n" % PaastaCheckMessages.YAML_MISSING

    yaml_check('path')
    output = mock_stdout.getvalue()

    assert output == expected_output
Beispiel #2
0
def test_check_yaml_check_fail(mock_is_file_in_dir, capfd):
    # marathon.yaml exists and is valid

    mock_is_file_in_dir.return_value = False
    expected_output = "%s\n" % PaastaCheckMessages.YAML_MISSING

    yaml_check('path')

    output, _ = capfd.readouterr()
    assert output == expected_output
Beispiel #3
0
def test_check_yaml_check_fail(mock_stdout, mock_is_file_in_dir):
    # marathon.yaml exists and is valid

    mock_is_file_in_dir.return_value = False
    expected_output = "%s\n" % PaastaCheckMessages.YAML_MISSING

    yaml_check('path')
    output = mock_stdout.getvalue().decode('utf-8')

    assert output == expected_output
Beispiel #4
0
def test_check_yaml_check_pass(mock_stdout, mock_is_file_in_dir):
    # marathon.yaml exists and is valid

    mock_is_file_in_dir.return_value = "/fake/path"
    expected_output = "%s\n%s\n" % (PaastaCheckMessages.MARATHON_YAML_FOUND,
                                    PaastaCheckMessages.CHRONOS_YAML_FOUND)

    yaml_check('path')
    output = mock_stdout.getvalue()

    assert output == expected_output
Beispiel #5
0
def test_check_yaml_check_pass(mock_stdout, mock_is_file_in_dir):
    # marathon.yaml exists and is valid

    mock_is_file_in_dir.return_value = "/fake/path"
    expected_output = "%s\n%s\n" % (PaastaCheckMessages.MARATHON_YAML_FOUND,
                                    PaastaCheckMessages.CHRONOS_YAML_FOUND)

    yaml_check('path')
    output = mock_stdout.getvalue()

    assert output == expected_output
Beispiel #6
0
def test_check_yaml_check_pass(mock_is_file_in_dir, capfd):
    # marathon.yaml exists and is valid

    mock_is_file_in_dir.return_value = "/fake/path"
    expected_output = "%s\n%s\n%s\n" % (
        PaastaCheckMessages.MARATHON_YAML_FOUND,
        PaastaCheckMessages.CHRONOS_YAML_FOUND,
        PaastaCheckMessages.ADHOC_YAML_FOUND,
    )

    yaml_check('path')

    output, _ = capfd.readouterr()
    assert output == expected_output