Skip to content

Commit

Permalink
👍️ Pass test gud
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezzsim committed Mar 29, 2024
1 parent 2e7a2b9 commit 3841b17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions suitcase/mongo_normalized/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import mongomock
import pytest
import uuid
from suitcase.mongo_normalized import Serializer



@pytest.fixture()
Expand All @@ -12,10 +14,12 @@ def inner():
database_name = f'test-{str(uuid.uuid4())}'
uri = 'mongodb://localhost:27017/'
client = mongomock.MongoClient(uri)

def drop():
client.drop_database(database_name)

request.addfinalizer(drop)
return client[database_name]
db = client[database_name]
serializer = Serializer(db, db)
serializer.create_indexes()
return db
return inner
1 change: 1 addition & 0 deletions suitcase/mongo_normalized/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def test_duplicates(db_factory, example_data):
metadatastore_db = db_factory()
asset_registry_db = db_factory()
serializer = Serializer(metadatastore_db, asset_registry_db)

for item in documents:
serializer(*item)
for item in documents:
Expand Down

0 comments on commit 3841b17

Please sign in to comment.