refactor: many changes

- Add missing actions and make a clear boundary between actions,
  services and nfra (i.e: actions shouldn't use stuff from infra/)
- Delete stuff not in use: tts, gtts, etc
- Add a ton of tests
This commit is contained in:
cătălin 2025-03-05 11:34:44 +01:00
commit 152546982c
No known key found for this signature in database
46 changed files with 2328 additions and 700 deletions

21
tests/test_models.py Normal file
View file

@ -0,0 +1,21 @@
from tests.conftest import ChatbotFactory, QuoteFactory
def test_chatbot_format_mods_from_string_validator(chatbot_factory: ChatbotFactory):
chatbot = chatbot_factory.build(mods="foo,bar")
assert chatbot.mods == ["foo", "bar"]
def test_chatbot_mods_as_string_returns_empty_string(chatbot_factory: ChatbotFactory):
modsless_chatbot = chatbot_factory.build(mods=[])
assert modsless_chatbot.mods_as_string == ""
def test_quote_as_pretty(quote_factory: QuoteFactory):
quote = quote_factory.build(quote="Foo", author="Bar")
assert quote.as_pretty() == "«Foo» - Bar"
def test_quote_as_pretty_saved(quote_factory: QuoteFactory):
quote = quote_factory.build(quote="Foo", author="Bar")
assert quote.as_pretty_saved() == "He añadido la cita «Foo» de Bar"