def test_readonly(self): delve = JsonDelver(self.file.name, readonly=True) with self.assertRaises(ReadonlyError): delve.write()
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)