def test_integration_good_bad_lines(tmpdir, bad_lines, good_lines, retval):
    file_path = os.path.join(tmpdir.strpath, 'foo.yaml')

    with open(file_path, 'w') as f:
        f.write('\n'.join(bad_lines) + '\n')

    assert main([file_path]) == retval

    with open(file_path, 'r') as f:
        assert [line.rstrip() for line in f.readlines()] == good_lines
def test_integration_good_bad_lines(tmpdir, bad_lines, good_lines, retval):
    file_path = os.path.join(tmpdir.strpath, 'foo.yaml')

    with open(file_path, 'w') as f:
        f.write("\n".join(bad_lines) + "\n")

    assert main([file_path]) == retval

    with open(file_path, 'r') as f:
        assert [line.rstrip() for line in f.readlines()] == good_lines