diff options
| author | Alexander Shorin <kxepal@gmail.com> | 2012-07-15 23:40:42 +0400 |
|---|---|---|
| committer | Alexander Shorin <kxepal@gmail.com> | 2012-07-15 23:40:42 +0400 |
| commit | b5d7bc7f98cbfdd7b1fb7508f5e4e352083f15de (patch) | |
| tree | 0e9c0e822696f3eadce8e7b1ef7b505cabbd0e60 | |
| parent | 76bc4422c190606b7c7b8ad8cb22cdf2e85ac433 (diff) | |
| download | python-json-patch-b5d7bc7f98cbfdd7b1fb7508f5e4e352083f15de.tar.gz | |
Add forgotten test case.
| -rwxr-xr-x | tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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() |
