def test_nested_files(): assert engine.get_diff('./tests/fixtures/test_nested_old.json', './tests/fixtures/test_nested_new.json', 'string') == STING_RESULT_NESTED assert engine.get_diff('./tests/fixtures/test_nested_old.json', './tests/fixtures/test_nested_new.json', 'plain') == PLAIN_RESULT_NESTED
def test_flat_files(): assert engine.get_diff('./tests/fixtures/test_flat_old.json', './tests/fixtures/test_flat_new.json', 'string') == STRING_RESULT_FLAT assert engine.get_diff('./tests/fixtures/test_flat_old.json', './tests/fixtures/test_flat_new.json', 'plain') == PLAIN_RESULT_FLAT assert engine.get_diff('./tests/fixtures/test_flat_old.yml', './tests/fixtures/test_flat_new.yml', 'string') == STRING_RESULT_FLAT assert engine.get_diff('./tests/fixtures/test_flat_old.yml', './tests/fixtures/test_flat_new.yml', 'plain') == PLAIN_RESULT_FLAT
def test_flat_json(): a = answer b = engine.get_diff( './tests/fixtures/test_flat_before.json', './tests/fixtures/test_flat_after.json', 'string' ) assert len(a) == len(b)
def test_get_diff2(): assert get_diff(yaml_load(BEFORE_REC_YAML ), yaml_load(AFTER_REC_YAML)) == json_load(EXP_GEN_DIFF)
def test_get_diff1(): assert get_diff(json_load(BEFORE_REC_JSON ), json_load(AFTER_REC_JSON)) == json_load(EXP_GEN_DIFF)
def test_nested(): a = answer b = engine.get_diff('./tests/fixtures/test_nested_old.json', './tests/fixtures/test_nested_new.json', 'string') assert len(a) == len(b)
def run(args): engine.get_diff(args.old_file, args.new_file, args.format)
def main(): first_dict, second_dict, format = arg_parse() print(format(get_diff(first_dict, second_dict)))