-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All persistence operations in the Aquarius class now use interactors …
…rather than persistence directly.
- Loading branch information
Showing
8 changed files
with
49 additions
and
6 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
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
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
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,7 @@ | ||
class GetBookTypeInteractor(object): | ||
|
||
def __init__(self, persistence): | ||
self.__persistence = persistence | ||
|
||
def execute(self, format_code): | ||
self.__persistence.get_book_type(format_code) |
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
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
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
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,13 @@ | ||
import unittest | ||
from unittest.mock import Mock | ||
from aquarius.interactors.GetBookTypeInteractor import GetBookTypeInteractor | ||
from aquarius.persistence.sqlitepersistence.SqlitePersistence import SqlitePersistence | ||
|
||
|
||
class TestGetBookTypeInteractor(unittest.TestCase): | ||
|
||
def test_get_book_type_interactor(self): | ||
persistence = Mock(SqlitePersistence) | ||
target = GetBookTypeInteractor(persistence) | ||
target.execute("format_code") | ||
self.assertTrue(persistence.get_book_type.called) |