diff options
author | Stefan Kögl <stefan@skoegl.net> | 2012-11-15 11:25:48 +0100 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2012-11-15 11:27:31 +0100 |
commit | ae11875d59b4c7ddb93e5d027adf13aa4bfed670 (patch) | |
tree | 28819ff9a2ff41188793d3ab1d83de66f4adede3 /tests.py | |
parent | 14b239c02cb7fb28b01b9b458b4a140cf4b9ccfd (diff) | |
download | python-json-patch-ae11875d59b4c7ddb93e5d027adf13aa4bfed670.tar.gz |
use jsonpointer, update to current spec draft
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -136,6 +136,20 @@ class ApplyPatchTestCase(unittest.TestCase): obj, [{'op': 'test', 'path': '/baz/qx'}]) + def test_unrecognized_element(self): + obj = {'foo': 'bar', 'baz': 'qux'} + res = jsonpatch.apply_patch(obj, [{'op': 'replace', 'path': '/baz', 'value': 'boo', 'foo': 'ignore'}]) + self.assertTrue(res['baz'], 'boo') + + + def test_append(self): + obj = {'foo': [1, 2]} + res = jsonpatch.apply_patch(obj, [ + {'op': 'add', 'path': '/foo/-', 'value': 3}, + {'op': 'add', 'path': '/foo/-', 'value': 4}, + ]) + + class EqualityTestCase(unittest.TestCase): |