gateway/tests/demo/test_demo_uc3_chatbot.py
ValueOn AG b6be8f391e fixes
2026-04-23 23:09:38 +02:00

39 lines
1.6 KiB
Python

"""
T-UC3: Knowledge Chatbot.
The chatbot feature instance was removed from the InvestorDemo on
2026-04-20 (see changelog) — neither HappyLife nor Alpina bootstrap a
chatbot today; the actual RAG demo runs via workspace. We still verify
the knowledge-base demo files are present and that the bootstrap does
NOT (re)create chatbot instances in either mandate.
"""
import pytest
from pathlib import Path
from tests.demo.conftest import _getFeatureInstances
class TestChatbotSetup:
def test_chatbotNotInHappylife(self, db, mandateHappylife):
"""HappyLife should NOT have a chatbot instance (removed 2026-04-20)."""
mid = mandateHappylife.get("id")
instances = _getFeatureInstances(db, mid, "chatbot")
assert len(instances) == 0, "HappyLife should no longer bootstrap a chatbot instance"
def test_chatbotNotInAlpina(self, db, mandateAlpina):
"""Alpina should NOT have a chatbot instance."""
mid = mandateAlpina.get("id")
instances = _getFeatureInstances(db, mid, "chatbot")
assert len(instances) == 0, "Alpina should not have chatbot"
class TestKnowledgeBaseFiles:
def test_knowledgeBaseFilesExist(self):
"""Knowledge-base documents must exist in demoData."""
kbDir = Path(__file__).resolve().parent.parent.parent / "demoData" / "knowledge-base"
assert kbDir.exists(), f"knowledge-base dir not found at {kbDir}"
files = list(kbDir.iterdir())
docs = [f for f in files if f.suffix in (".md", ".html", ".pdf", ".docx", ".txt")]
assert len(docs) >= 3, f"Expected at least 3 knowledge-base docs, found {len(docs)}: {[f.name for f in docs]}"