Adding document service
This commit is contained in:
@@ -23,9 +23,9 @@ async def in_memory_repository():
|
||||
"""Create an in-memory FileDocumentRepository for testing."""
|
||||
client = AsyncMongoMockClient()
|
||||
db = client.test_database
|
||||
repo = FileDocumentRepository()
|
||||
repo.db = db
|
||||
repo.collection = db.files
|
||||
repo = FileDocumentRepository(db)
|
||||
# repo.db = db
|
||||
# repo.collection = db.files
|
||||
await repo.initialize()
|
||||
return repo
|
||||
|
||||
@@ -87,12 +87,15 @@ class TestFileDocumentRepositoryInitialization:
|
||||
async def test_i_can_initialize_repository(self):
|
||||
"""Test repository initialization."""
|
||||
# Arrange
|
||||
repo = FileDocumentRepository()
|
||||
client = AsyncMongoMockClient()
|
||||
db = client.test_database
|
||||
repo = FileDocumentRepository(db)
|
||||
await repo.initialize()
|
||||
|
||||
# Act & Assert (should not raise any exception)
|
||||
assert repo.db is not None
|
||||
assert repo.collection is not None
|
||||
# TODO : check that the indexes are create
|
||||
|
||||
|
||||
class TestFileDocumentRepositoryCreation:
|
||||
|
||||
Reference in New Issue
Block a user