diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-11-19 22:59:42 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-11-20 01:02:43 +0100 |
commit | d0128400614f87f8e08d369025b1259b36c566e5 (patch) | |
tree | 33dddbfbd8ef565c790a6e85f25e4f23c61c5e01 /test_json_diff.py | |
parent | 536c112a1c7b808729cb6e7f1103e1a541f10ce7 (diff) | |
download | json_diff-d0128400614f87f8e08d369025b1259b36c566e5.tar.gz |
Option -i which allows only enumerated attributes to be considered.
All tests pass (including the large piglit one, except I keep it commented
out, it takes over 4.5 minutes to finish).
Diffstat (limited to 'test_json_diff.py')
-rw-r--r-- | test_json_diff.py | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/test_json_diff.py b/test_json_diff.py index 2d073ea..a4f40e4 100644 --- a/test_json_diff.py +++ b/test_json_diff.py @@ -35,18 +35,6 @@ class OurTestCase(unittest.TestCase): "\n\nexpected = %s\n\nobserved = %s" % (expected, diff)) -#class TestUtilities(unittest.TestCase): -# def test_is_dict_interesting(self): -# diffator = json_diff.Comparator(StringIO(NESTED_OLD), StringIO(NESTED_NEW), -# included_attrs=('nome',)) -# old_res = diffator.dict_no_key_included(diffator.obj1) -# self.assertFalse(old_res, -# "check whether the old dict should be excluded or not") # or True? FIXME -# new_res = diffator.dict_no_key_included(diffator.obj2) -# self.assertFalse(new_res, -# "check whether the new dict should be excluded or not") # or True? FIXME - - class TestBasicJSONHappyPath(OurTestCase): def test_empty(self): diffator = json_diff.Comparator({}, {}) @@ -106,11 +94,11 @@ class TestBasicJSONHappyPath(OurTestCase): def test_nested_excluded(self): self._run_test_strings(NESTED_OLD, NESTED_NEW, NESTED_DIFF_EXCL, - "Nested objects diff.", exc=("nome",)) + "Nested objects diff with exclusion.", exc=("nome",)) -# def test_nested_included(self): -# self._run_test_strings(NESTED_OLD, NESTED_NEW, NESTED_DIFF_INCL, -# "Nested objects diff.", inc=("nome",)) + def test_nested_included(self): + self._run_test_strings(NESTED_OLD, NESTED_NEW, NESTED_DIFF_INCL, + "Nested objects diff.", inc=("nome",)) class TestBasicJSONSadPath(OurTestCase): def test_no_JSON(self): @@ -127,12 +115,10 @@ class TestBasicJSONSadPath(OurTestCase): '{"a": 01}', '{"a": 2}', '{"_update": {"a": 2}}', "Octal numbers not supported") - -#class TestPiglitData(OurTestCase): -# pass -# def test_piglit_results(self): -# self._run_test(open("test/old-testing-data.json"), open("test/new-testing-data.json"), -# open("test/diff-testing-data.json"), "Large piglit results diff.") +# class TestPiglitData(OurTestCase): +# def test_piglit_results(self): +# self._run_test(open("test/old-testing-data.json"), open("test/new-testing-data.json"), +# open("test/diff-testing-data.json"), "Large piglit results diff.") if __name__ == "__main__": unittest.main() |