-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
실제 컨테이너를 통해 객체를 구성하고 테스트 코드에서의 기능 사용 방식 변경
- Loading branch information
Showing
2 changed files
with
22 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from src.appl.create_calendar import CreateCalendar | ||
from src.appl.i_container import IContainer | ||
from src.infra.repo.sa import SA | ||
from src.infra.repo.sa_calendar_repo import SACalendarRepo | ||
from src.infra.repo.sa_context import SAContext | ||
|
||
|
||
class Container(IContainer): | ||
def compose(self) -> None: | ||
# repository | ||
self.register(SA("postgresql://qodot@localhost/lifecalendar", {})) | ||
self.register(SAContext(self.resolve(SA))) | ||
self.register(SACalendarRepo(self.resolve(SA))) | ||
|
||
# application | ||
self.register( | ||
CreateCalendar(self.resolve(SAContext), self.resolve(SACalendarRepo)) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters