Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mlco2_codecarbon /carbonserver /tests /api /container_test.py
| from dependency_injector import containers, providers | |
| from carbonserver.api.infra.repositories.repository_projects import ( | |
| SqlAlchemyRepository as ProjectSqlRepository, | |
| ) | |
| from carbonserver.api.services.project_service import ProjectService | |
| class DatabaseMock: | |
| def __init__(self, db_url): | |
| self.db_url = db_url | |
| class AuthContextMock: | |
| def isOperationAuthorizedOnOrg(): | |
| return True | |
| def isOperationAuthorizedOnProject(): | |
| return True | |
| class FakeContainer(containers.DeclarativeContainer): | |
| db = providers.Singleton( | |
| DatabaseMock, | |
| db_url=None, | |
| ) | |
| projects_repository = providers.Factory( | |
| ProjectSqlRepository, | |
| session_factory=db.provided.session, | |
| ) | |
| project_service = providers.Factory( | |
| ProjectService, | |
| projects_repository=projects_repository, | |
| auth_context=AuthContextMock(), | |
| ) | |
Xet Storage Details
- Size:
- 933 Bytes
- Xet hash:
- b2f7fc066d74904125fb20059544d453382735a807dde8f352f96598553fa632
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.