feat: implement remaining repo methods for chatbot and quote

This commit is contained in:
cătălin 2025-03-07 00:28:05 +01:00
commit 4b7ffbc914
No known key found for this signature in database
10 changed files with 352 additions and 177 deletions

View file

@ -65,7 +65,7 @@ def db(s, cdb):
pass
async def list( # type: ignore[empty-body]
self, obj: BaseModel, offset: int = 0, limit: int = 10, auto_commit=True
self, offset: int = 0, limit: int = 10, auto_commit=True
) -> list[BaseModel]:
pass
@ -169,6 +169,16 @@ async def chatbot(chatbot_factory, user):
return chatbot_factory.build(user_id=user.id)
@pytest.fixture
async def five_chatbots(chatbot_factory, user):
return [chatbot_factory.build() for _ in range(5)]
@pytest.fixture
async def persisted_five_chatbots(five_chatbots, chatbot_repo):
return [await chatbot_repo.create(chatbot) for chat in five_chatbots]
@pytest.fixture
async def persisted_chatbot(chatbot_repo, chatbot, persisted_user):
return await chatbot_repo.create(chatbot)
@ -204,11 +214,21 @@ async def quote(quote_factory):
return quote_factory.build()
@pytest.fixture
async def five_quotes(quote_factory):
return [quote_factory.build() for _ in range(5)]
@pytest.fixture
async def persisted_quote(quote_repo, quote):
return await quote_repo.create(quote)
@pytest.fixture
async def persisted_five_quotes(five_quotes, quote_repo):
return [await quote_repo.create(quote) for quote in five_quotes]
@pytest.fixture
async def create_quote_svc(quote_repo):
return CreateQuoteSvc(repo=quote_repo)