def test_failed(self, _document): # TypeError document = load(1234) self.assertEqual(document, _document.return_value) # ValueError document = load('[[[') self.assertEqual(document, _document.return_value)
def test_load(self): document = load('{"A": 1}') self.assertTrue(isinstance(document, Document)) self.assertEqual(document['A'], 1)