diff options
| author | Stefan Kögl <stefan@skoegl.net> | 2014-06-24 20:33:47 +0200 |
|---|---|---|
| committer | Stefan Kögl <stefan@skoegl.net> | 2014-06-24 20:33:47 +0200 |
| commit | a2e51fb518e02eef9622d00b0009edc6098b1d7a (patch) | |
| tree | 7d831ab9bf72caad4604ceb2140ba11f393f388b /tests.py | |
| parent | 036045d79a46df894983dffc0641f535f5cf8d99 (diff) | |
| download | python-json-patch-a2e51fb518e02eef9622d00b0009edc6098b1d7a.tar.gz | |
Fix make_patch() when root is an array (fixes #28)
Diffstat (limited to 'tests.py')
| -rwxr-xr-x | tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -341,6 +341,14 @@ class MakePatchTestCase(unittest.TestCase): res = patch.apply(src) self.assertEqual(res, dst) + def test_root_list(self): + """ Test making and applying a patch of the root is a list """ + src = [{'foo': 'bar', 'boo': 'qux'}] + dst = [{'baz': 'qux', 'foo': 'boo'}] + patch = jsonpatch.make_patch(src, dst) + res = patch.apply(src) + self.assertEqual(res, dst) + class InvalidInputTests(unittest.TestCase): |
