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