Exemplo n.º 1
0
 def test_test(self):
   d = self.document
   self.assertTrue(jp.apply_patch(d, jp.Patch(op="test", path="/age")))
   self.assertTrue(jp.apply_patch(d, jp.Patch(op="test", path="/age", value=31)))
   self.assertFalse(jp.apply_patch(d, jp.Patch(op="test", path="/age", value=32)))
   self.assertFalse(jp.apply_patch(d, jp.Patch(op="test", path="/hamburger_count")))
   self.assertFalse(jp.apply_patch(d, jp.Patch(op="test", path="/hamburger_count", value="the, all of")))
Exemplo n.º 2
0
 def apply_patch(self, patch):
   jp.apply_patch(self.document, patch)
   return self.document