From e5a45bf5841f9f959fb13b9907a89d65fa275f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Tue, 9 Jul 2013 12:49:02 +0200 Subject: add test for comparing patches to other types --- tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests.py b/tests.py index 82aa823..a7a365c 100755 --- a/tests.py +++ b/tests.py @@ -185,6 +185,13 @@ class EqualityTestCase(unittest.TestCase): self.assertNotEqual(hash(patch1), hash(patch2)) + def test_patch_neq_other_objs(self): + p = [{'op': 'test', 'path': '/test'}] + patch = jsonpatch.JsonPatch(p) + # a patch will always compare not-equal to objects of other types + self.assertFalse(patch == p) + self.assertFalse(patch == None) + -- cgit v1.2.1