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

Method test_document_class

test/test_client.py:1263–1277  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1261 connected(c)
1262
1263 def test_document_class(self):
1264 c = self.client
1265 db = c.pymongo_test
1266 db.test.insert_one({"x": 1})
1267
1268 self.assertEqual(dict, c.codec_options.document_class)
1269 self.assertIsInstance(db.test.find_one(), dict)
1270 self.assertNotIsInstance(db.test.find_one(), SON)
1271
1272 c = self.rs_or_single_client(document_class=SON)
1273
1274 db = c.pymongo_test
1275
1276 self.assertEqual(SON, c.codec_options.document_class)
1277 self.assertIsInstance(db.test.find_one(), SON)
1278
1279 def test_timeouts(self):
1280 client = self.rs_or_single_client(

Callers

nothing calls this directly

Calls 3

rs_or_single_clientMethod · 0.80
insert_oneMethod · 0.45
find_oneMethod · 0.45

Tested by

no test coverage detected