summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2013-07-09 12:49:02 +0200
committerStefan Kögl <stefan@skoegl.net>2013-07-09 12:49:02 +0200
commite5a45bf5841f9f959fb13b9907a89d65fa275f0f (patch)
treeb73661118d31e5e406ef95d066c46fd053a5f4b5
parent4ed55a3fb5e85ccf95ffa0f505c72af5b4bb447d (diff)
downloadpython-json-patch-e5a45bf5841f9f959fb13b9907a89d65fa275f0f.tar.gz
add test for comparing patches to other types
-rwxr-xr-xtests.py7
1 files changed, 7 insertions, 0 deletions
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)
+