MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_index_background

Method test_index_background

test/test_collection.py:540–548  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

538 self.assertTrue((db.test.index_information())["key_1"]["sparse"])
539
540 def test_index_background(self):
541 db = self.db
542 db.test.drop_indexes()
543 db.test.create_index([("keya", ASCENDING)])
544 db.test.create_index([("keyb", ASCENDING)], background=False)
545 db.test.create_index([("keyc", ASCENDING)], background=True)
546 self.assertNotIn("background", (db.test.index_information())["keya_1"])
547 self.assertFalse((db.test.index_information())["keyb_1"]["background"])
548 self.assertTrue((db.test.index_information())["keyc_1"]["background"])
549
550 def _drop_dups_setup(self, db):
551 db.drop_collection("test")

Callers

nothing calls this directly

Calls 3

drop_indexesMethod · 0.45
create_indexMethod · 0.45
index_informationMethod · 0.45

Tested by

no test coverage detected