コード例 #1
0
 def test_readonly(self):
     delve = JsonDelver(self.file.name, readonly=True)
     with self.assertRaises(ReadonlyError):
         delve.write()
コード例 #2
0
 def test_write(self):
     delve = JsonDelver(self.file.name)
     delve.set('/newkey', 'something')
     delve.write()
     written = json.load(open(self.file.name, 'r'))
     self.assertEqual(written, delve.data)