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

Method test_find_one

test/test_monitoring.py:106–120  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

104 self.assertIsInstance(failed.duration_micros, int)
105
106 def test_find_one(self):
107 self.client.pymongo_test.test.find_one()
108 started = self.listener.started_events[0]
109 succeeded = self.listener.succeeded_events[0]
110 self.assertEqual(0, len(self.listener.failed_events))
111 self.assertIsInstance(succeeded, monitoring.CommandSucceededEvent)
112 self.assertIsInstance(started, monitoring.CommandStartedEvent)
113 self.assertEqualCommand(
114 SON([("find", "test"), ("filter", {}), ("limit", 1), ("singleBatch", True)]),
115 started.command,
116 )
117 self.assertEqual("find", started.command_name)
118 self.assertEqual(self.client.address, started.connection_id)
119 self.assertEqual("pymongo_test", started.database_name)
120 self.assertIsInstance(started.request_id, int)
121
122 def test_find_and_get_more(self):
123 self.client.pymongo_test.test.drop()

Callers

nothing calls this directly

Calls 3

SONClass · 0.90
find_oneMethod · 0.45
assertEqualCommandMethod · 0.45

Tested by

no test coverage detected