Skip to content

Commit 6761340

Browse files
tyerqselurvedu
authored andcommitted
added error-prone cases to default tests
1 parent c106735 commit 6761340

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,38 @@ def test_root_list(self):
356356
res = patch.apply(src)
357357
self.assertEqual(res, dst)
358358

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+
359391

360392
class InvalidInputTests(unittest.TestCase):
361393

0 commit comments

Comments
 (0)