Exemple #1
0
def test_check_docker_check_file_not_found(
        mock_stdout, mock_docker_file_reads_from_yelpcorp,
        mock_is_file_in_dir):

    mock_is_file_in_dir.return_value = False
    mock_docker_file_reads_from_yelpcorp.return_value = False

    docker_check()
    output = mock_stdout.getvalue()

    assert PaastaCheckMessages.DOCKERFILE_MISSING in output
    assert PaastaCheckMessages.DOCKERFILE_NOT_YELPCORP not in output
Exemple #2
0
def test_check_docker_check_doesnt_read_yelpcorp(
        mock_stdout, mock_docker_file_reads_from_yelpcorp,
        mock_is_file_in_dir):

    mock_is_file_in_dir.return_value = "/fake/path"
    mock_docker_file_reads_from_yelpcorp.return_value = False

    docker_check()
    output = mock_stdout.getvalue()

    assert PaastaCheckMessages.DOCKERFILE_FOUND in output
    assert PaastaCheckMessages.DOCKERFILE_NOT_YELPCORP in output
Exemple #3
0
def test_check_docker_check_file_not_found(
        mock_stdout, mock_docker_file_reads_from_yelpcorp,
        mock_is_file_in_dir):

    mock_is_file_in_dir.return_value = False
    mock_docker_file_reads_from_yelpcorp.return_value = False

    docker_check()
    output = mock_stdout.getvalue()

    assert PaastaCheckMessages.DOCKERFILE_MISSING in output
    assert PaastaCheckMessages.DOCKERFILE_NOT_YELPCORP not in output
Exemple #4
0
def test_check_docker_check_doesnt_read_yelpcorp(
        mock_stdout, mock_docker_file_reads_from_yelpcorp,
        mock_is_file_in_dir):

    mock_is_file_in_dir.return_value = "/fake/path"
    mock_docker_file_reads_from_yelpcorp.return_value = False

    docker_check()
    output = mock_stdout.getvalue()

    assert PaastaCheckMessages.DOCKERFILE_FOUND in output
    assert PaastaCheckMessages.DOCKERFILE_NOT_YELPCORP in output
Exemple #5
0
def test_check_docker_check_pass(
        mock_stdout, mock_docker_file_reads_from_yelpcorp,
        mock_is_file_in_dir):
    # Dockerfile exists and is valid

    mock_is_file_in_dir.return_value = "/fake/path"
    mock_docker_file_reads_from_yelpcorp.return_value = True

    docker_check()
    output = mock_stdout.getvalue()

    assert PaastaCheckMessages.DOCKERFILE_FOUND in output
    assert PaastaCheckMessages.DOCKERFILE_YELPCORP in output
Exemple #6
0
def test_check_docker_check_pass(mock_stdout,
                                 mock_docker_file_reads_from_yelpcorp,
                                 mock_is_file_in_dir):
    # Dockerfile exists and is valid

    mock_is_file_in_dir.return_value = "/fake/path"
    mock_docker_file_reads_from_yelpcorp.return_value = True

    docker_check()
    output = mock_stdout.getvalue()

    assert PaastaCheckMessages.DOCKERFILE_FOUND in output
    assert PaastaCheckMessages.DOCKERFILE_YELPCORP in output