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

Method test_check_exists

test/test_database.py:231–242  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

229 self.assertTrue(command["nameOnly"])
230
231 def test_check_exists(self):
232 listener = OvertCommandListener()
233 client = self.rs_or_single_client(event_listeners=[listener])
234 db = client[self.db.name]
235 db.drop_collection("unique")
236 db.create_collection("unique", check_exists=True)
237 self.assertIn("listCollections", listener.started_command_names())
238 listener.reset()
239 db.drop_collection("unique")
240 db.create_collection("unique", check_exists=False)
241 self.assertGreater(len(listener.started_events), 0)
242 self.assertNotIn("listCollections", listener.started_command_names())
243
244 def test_list_collections(self):
245 self.client.drop_database("pymongo_test")

Callers

nothing calls this directly

Calls 6

rs_or_single_clientMethod · 0.80
started_command_namesMethod · 0.80
drop_collectionMethod · 0.45
create_collectionMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected