예제 #1
0
def parser():
    parser = argparse.ArgumentParser(description='Generate diff')
    parser.add_argument('first_file', type=str, help='')
    parser.add_argument('second_file', type=str, help='')
    parser.add_argument('-f',
                        '--format',
                        dest="format",
                        type=str,
                        help='set format of output',
                        default='stylish')
    args = parser.parse_args()
    answer = render_diff(args.first_file, args.second_file, args.format)
    return answer
예제 #2
0
def test_diff_json_yaml():
    assert render_diff(
        nested_1_yaml, nested_2_yaml, 'json_format') == json_structure
예제 #3
0
def test_diff_json_json():
    assert render_diff(
        nested_1_json, nested_2_json, 'json_format') == json_structure
예제 #4
0
def test_diff_plain_yaml():
    assert render_diff(
        nested_1_yaml, nested_2_yaml, 'plain') == plain_structure
예제 #5
0
def test_diff_plain_json():
    assert render_diff(
        nested_1_json, nested_2_json, 'plain') == plain_structure
예제 #6
0
def test_diff_stylish_yaml():
    assert render_diff(
        nested_1_yaml, nested_2_yaml, 'stylish') == stylish_structure
예제 #7
0
def test_diff_stylish_json():
    assert render_diff(
        nested_1_json, nested_2_json, 'stylish') == stylish_structure
예제 #8
0
def test_diff_yaml():
    assert render_diff(plain_1_yaml, plain_2_yaml, 'plain') == simple
예제 #9
0
def test_diff_json():
    assert render_diff(plain_1_json, plain_2_json, 'stylish') == simple
예제 #10
0
def test_diff_json():
    assert render_diff('tests/fixtures/files/1_plain.json', 'tests/fixtures/files/2_plain.json', 'stylish') == simple