summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@gmail.com>2012-07-15 23:40:42 +0400
committerAlexander Shorin <kxepal@gmail.com>2012-07-15 23:40:42 +0400
commitb5d7bc7f98cbfdd7b1fb7508f5e4e352083f15de (patch)
tree0e9c0e822696f3eadce8e7b1ef7b505cabbd0e60
parent76bc4422c190606b7c7b8ad8cb22cdf2e85ac433 (diff)
downloadpython-json-patch-b5d7bc7f98cbfdd7b1fb7508f5e4e352083f15de.tar.gz
Add forgotten test case.
-rwxr-xr-xtests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index 82a3e34..8caec43 100755
--- a/tests.py
+++ b/tests.py
@@ -125,6 +125,13 @@ class MakePatchTestCase(unittest.TestCase):
res = patch.apply(src)
self.assertEqual(res, dst)
+ def test_array_add_remove(self):
+ # see https://github.com/stefankoegl/python-json-patch/issues/4
+ src = {'numbers': [], 'other': [1, 5, 3, 4]}
+ dst = {'numbers': [1, 3, 4, 5], 'other': []}
+ patch = jsonpatch.make_patch(src, dst)
+ res = patch.apply(src)
+ self.assertEqual(res, dst)
def suite():
suite = unittest.TestSuite()