Conversation
| from repka.repositories.base import GenericIdModel, AsyncBaseRepo, AsyncQueryExecutor | ||
|
|
||
|
|
||
| class Repository(AsyncBaseRepo[GenericIdModel], ABC): |
There was a problem hiding this comment.
А че этот класс дает? Как мокать AiopgRepository? Там же по-прежнему коннекшн на вход
There was a problem hiding this comment.
всм коннекшен? Там не коннекшен, там query_executor:
def __init__(self, query_executor: AsyncQueryExecutor):
self._query_executor = query_executor
There was a problem hiding this comment.
Ну, AiopgRepository для обратной совместимости вообще функционально не изменился
А вот в Repository можно уже подставлять произвольный экзекутор, в том числе и мок
То есть, предлагаю юзать Repository в проекте, подставляя нужный экзекутор
There was a problem hiding this comment.
Тогда почему бы не перенести конструктор в AsyncBaseRepo и избавится от класса Repository?
def __init__(self, query_executor: AsyncQueryExecutor):
self._query_executor = query_executor
potykion
left a comment
There was a problem hiding this comment.
Бля гх чет не отправил коммент
| from repka.repositories.base import GenericIdModel, AsyncBaseRepo, AsyncQueryExecutor | ||
|
|
||
|
|
||
| class Repository(AsyncBaseRepo[GenericIdModel], ABC): |
There was a problem hiding this comment.
Тогда почему бы не перенести конструктор в AsyncBaseRepo и избавится от класса Repository?
def __init__(self, query_executor: AsyncQueryExecutor):
self._query_executor = query_executor
PR merge checklist:
add tests for new functionality if any
run
poetry install && pre-commit run -adescribe changes in CHANGELOG.md with PR/issue reference like so
ensure build passed
Надо подумать над названием, пока ниче кроме Repository не придумал