Skip to content

Commit ea63fe4

Browse files
committed
remove encrypted collections
1 parent cb1031b commit ea63fe4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/asynchronous/unified_format.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ async def insert_initial_data(self, initial_data):
482482
wc = WriteConcern(w="majority")
483483
else:
484484
wc = WriteConcern(w=1)
485+
485486
if documents:
486487
if opts:
487488
await db.create_collection(coll_name, **opts)
@@ -490,6 +491,12 @@ async def insert_initial_data(self, initial_data):
490491
# Ensure collection exists
491492
await db.create_collection(coll_name, write_concern=wc, **opts)
492493

494+
# Remove any encryption collections associated with the collection.
495+
collections = await db.list_collection_names()
496+
for collection in collections:
497+
if collection in [f"nxcol_{coll_name}.esc", "enxcol_{coll_name}.ecoc"]:
498+
await db.drop_collection(collection)
499+
493500
@classmethod
494501
def setUpClass(cls) -> None:
495502
# Speed up the tests by decreasing the heartbeat frequency.
@@ -508,6 +515,7 @@ def tearDownClass(cls) -> None:
508515
async def asyncSetUp(self):
509516
# super call creates internal client cls.client
510517
await super().asyncSetUp()
518+
511519
# process file-level runOnRequirements
512520
run_on_spec = self.TEST_SPEC.get("runOnRequirements", [])
513521
if not await self.should_run_on(run_on_spec):

test/unified_format.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ def insert_initial_data(self, initial_data):
481481
wc = WriteConcern(w="majority")
482482
else:
483483
wc = WriteConcern(w=1)
484+
484485
if documents:
485486
if opts:
486487
db.create_collection(coll_name, **opts)
@@ -489,6 +490,12 @@ def insert_initial_data(self, initial_data):
489490
# Ensure collection exists
490491
db.create_collection(coll_name, write_concern=wc, **opts)
491492

493+
# Remove any encryption collections associated with the collection.
494+
collections = db.list_collection_names()
495+
for collection in collections:
496+
if collection in [f"nxcol_{coll_name}.esc", "enxcol_{coll_name}.ecoc"]:
497+
db.drop_collection(collection)
498+
492499
@classmethod
493500
def setUpClass(cls) -> None:
494501
# Speed up the tests by decreasing the heartbeat frequency.
@@ -507,6 +514,7 @@ def tearDownClass(cls) -> None:
507514
def setUp(self):
508515
# super call creates internal client cls.client
509516
super().setUp()
517+
510518
# process file-level runOnRequirements
511519
run_on_spec = self.TEST_SPEC.get("runOnRequirements", [])
512520
if not self.should_run_on(run_on_spec):

0 commit comments

Comments
 (0)