MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_loads_document_class

Method test_loads_document_class

test/test_json_util.py:579–586  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

577 )
578
579 def test_loads_document_class(self):
580 json_doc = '{"foo": "bar", "b": 1, "d": {"a": 1}}'
581 expected_doc = {"foo": "bar", "b": 1, "d": {"a": 1}}
582 for cls in (dict, SON, OrderedDict):
583 doc = json_util.loads(json_doc, json_options=JSONOptions(document_class=cls))
584 self.assertEqual(doc, expected_doc)
585 self.assertIsInstance(doc, cls)
586 self.assertIsInstance(doc["d"], cls)
587
588 def test_encode_subclass(self):
589 cases: list[Tuple[Type, Any]] = [

Callers

nothing calls this directly

Calls 1

JSONOptionsClass · 0.90

Tested by

no test coverage detected