@@ -356,6 +356,38 @@ def test_root_list(self):
356
356
res = patch .apply (src )
357
357
self .assertEqual (res , dst )
358
358
359
+ def test_fail_prone_list_1 (self ):
360
+ """ Test making and applying a patch of the root is a list """
361
+ src = [u'a' , u'r' , u'b' ]
362
+ dst = [u'b' , u'o' ]
363
+ patch = jsonpatch .make_patch (src , dst )
364
+ res = patch .apply (src )
365
+ self .assertEqual (res , dst )
366
+
367
+ def test_fail_prone_list_2 (self ):
368
+ """ Test making and applying a patch of the root is a list """
369
+ src = [u'a' , u'r' , u'b' , u'x' , u'm' , u'n' ]
370
+ dst = [u'b' , u'o' , u'm' , u'n' ]
371
+ patch = jsonpatch .make_patch (src , dst )
372
+ res = patch .apply (src )
373
+ self .assertEqual (res , dst )
374
+
375
+ def test_fail_prone_list_3 (self ):
376
+ """ Test making and applying a patch of the root is a list """
377
+ src = [u'boo1' , u'bar' , u'foo1' , u'qux' ]
378
+ dst = [u'qux' , u'bar' ]
379
+ patch = jsonpatch .make_patch (src , dst )
380
+ res = patch .apply (src )
381
+ self .assertEqual (res , dst )
382
+
383
+ def test_fail_prone_list_4 (self ):
384
+ """ Test making and applying a patch of the root is a list """
385
+ src = [u'bar1' , 59 , u'foo1' , u'foo' ]
386
+ dst = [u'foo' , u'bar' , u'foo1' ]
387
+ patch = jsonpatch .make_patch (src , dst )
388
+ res = patch .apply (src )
389
+ self .assertEqual (res , dst )
390
+
359
391
360
392
class InvalidInputTests (unittest .TestCase ):
361
393
0 commit comments