Example #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
Example #2
0
def test_diff_json_yaml():
    assert render_diff(
        nested_1_yaml, nested_2_yaml, 'json_format') == json_structure
Example #3
0
def test_diff_json_json():
    assert render_diff(
        nested_1_json, nested_2_json, 'json_format') == json_structure
Example #4
0
def test_diff_plain_yaml():
    assert render_diff(
        nested_1_yaml, nested_2_yaml, 'plain') == plain_structure
Example #5
0
def test_diff_plain_json():
    assert render_diff(
        nested_1_json, nested_2_json, 'plain') == plain_structure
Example #6
0
def test_diff_stylish_yaml():
    assert render_diff(
        nested_1_yaml, nested_2_yaml, 'stylish') == stylish_structure
Example #7
0
def test_diff_stylish_json():
    assert render_diff(
        nested_1_json, nested_2_json, 'stylish') == stylish_structure
Example #8
0
def test_diff_yaml():
    assert render_diff(plain_1_yaml, plain_2_yaml, 'plain') == simple
Example #9
0
def test_diff_json():
    assert render_diff(plain_1_json, plain_2_json, 'stylish') == simple
Example #10
0
def test_diff_json():
    assert render_diff('tests/fixtures/files/1_plain.json', 'tests/fixtures/files/2_plain.json', 'stylish') == simple