Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
def test_get_diff2():
    assert get_diff(yaml_load(BEFORE_REC_YAML
        ), yaml_load(AFTER_REC_YAML)) == json_load(EXP_GEN_DIFF)
Exemplo n.º 5
0
def test_get_diff1():
    assert get_diff(json_load(BEFORE_REC_JSON
        ), json_load(AFTER_REC_JSON)) == json_load(EXP_GEN_DIFF)
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
def run(args):
    engine.get_diff(args.old_file, args.new_file, args.format)
Exemplo n.º 8
0
def main():
    first_dict, second_dict, format = arg_parse()
    print(format(get_diff(first_dict, second_dict)))