diff options
author | Stas Erema <tyerq@ukr.net> | 2015-08-18 16:28:07 +0300 |
---|---|---|
committer | selurvedu <selurvedu@users.noreply.github.com> | 2016-04-08 04:38:18 +0000 |
commit | 6761340d8b4eae3419eebfb202c09f9956387148 (patch) | |
tree | f5909fe006a62dc85b39ddb43eeb94d82f91124b | |
parent | c1067351a798534dda59aadccdfe5eb96fd520b4 (diff) | |
download | python-json-patch-6761340d8b4eae3419eebfb202c09f9956387148.tar.gz |
added error-prone cases to default tests
-rwxr-xr-x | tests.py | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -356,6 +356,38 @@ class MakePatchTestCase(unittest.TestCase): res = patch.apply(src) self.assertEqual(res, dst) + def test_fail_prone_list_1(self): + """ Test making and applying a patch of the root is a list """ + src = [u'a', u'r', u'b'] + dst = [u'b', u'o'] + patch = jsonpatch.make_patch(src, dst) + res = patch.apply(src) + self.assertEqual(res, dst) + + def test_fail_prone_list_2(self): + """ Test making and applying a patch of the root is a list """ + src = [u'a', u'r', u'b', u'x', u'm', u'n'] + dst = [u'b', u'o', u'm', u'n'] + patch = jsonpatch.make_patch(src, dst) + res = patch.apply(src) + self.assertEqual(res, dst) + + def test_fail_prone_list_3(self): + """ Test making and applying a patch of the root is a list """ + src = [u'boo1', u'bar', u'foo1', u'qux'] + dst = [u'qux', u'bar'] + patch = jsonpatch.make_patch(src, dst) + res = patch.apply(src) + self.assertEqual(res, dst) + + def test_fail_prone_list_4(self): + """ Test making and applying a patch of the root is a list """ + src = [u'bar1', 59, u'foo1', u'foo'] + dst = [u'foo', u'bar', u'foo1'] + patch = jsonpatch.make_patch(src, dst) + res = patch.apply(src) + self.assertEqual(res, dst) + class InvalidInputTests(unittest.TestCase): |