diff options
| author | Stefan Kögl <stefan@skoegl.net> | 2012-09-05 17:21:43 +0200 |
|---|---|---|
| committer | Stefan Kögl <stefan@skoegl.net> | 2012-09-05 17:21:43 +0200 |
| commit | 5480cc5a8be2313a37e7cc2a1c265e91c51d86aa (patch) | |
| tree | 81aee425169f89a8b3bfe76696903a5b32c821be /tests.py | |
| parent | ffd125cd891b47c66b9eb18a04411c47aa880d90 (diff) | |
| download | python-json-patch-5480cc5a8be2313a37e7cc2a1c265e91c51d86aa.tar.gz | |
ref current spec, add its new test case
the updated spec [1] didn't change anything that would make a new version of
python-json-patch necessary. This commit only updates the reference to the
current version, and adds a new example
[1] http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-03
Diffstat (limited to 'tests.py')
| -rwxr-xr-x | tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -133,6 +133,16 @@ class MakePatchTestCase(unittest.TestCase): res = patch.apply(src) self.assertEqual(res, dst) + def test_add_nested(self): + # see http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-03#appendix-A.10 + src = {"foo": "bar"} + patch_obj = [ { "add": "/child", "value": { "grandchild": { } } } ] + res = jsonpatch.apply_patch(src, patch_obj) + expected = { "foo": "bar", + "child": { "grandchild": { } } + } + self.assertEqual(expected, res) + def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(jsonpatch)) |
