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

Method test_index_hashed

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

Source from the content-addressed store, hash-verified

518 db.test.drop_indexes()
519
520 def test_index_hashed(self):
521 db = self.db
522 db.test.drop_indexes()
523 self.assertEqual("a_hashed", db.test.create_index([("a", HASHED)]))
524
525 for dummy, info in (db.test.index_information()).items():
526 field, idx_type = info["key"][0]
527 if field == "a" and idx_type == "hashed":
528 break
529 else:
530 self.fail("hashed index not found.")
531
532 db.test.drop_indexes()
533
534 def test_index_sparse(self):
535 db = self.db

Callers

nothing calls this directly

Calls 4

itemsMethod · 0.80
drop_indexesMethod · 0.45
create_indexMethod · 0.45
index_informationMethod · 0.45

Tested by

no test coverage detected