Noor2623's picture
Add Gemini query routing and department-scoped ticket access
eeff6a0
Raw History Blame Contribute Delete
1.03 kB
import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from app.core.database import Base
from app.models.department import Department
from app.services.routing_service import match_department
@pytest.mark.parametrize("include_finance", [False, True])
def test_unmatched_query_without_admin_stays_unassigned(include_finance):
engine = create_engine("sqlite+pysqlite:///:memory:")
try:
Base.metadata.create_all(engine)
with Session(engine) as db:
if include_finance:
db.add(Department(
name="Finance",
code="FIN",
keywords="tuition, fee, refund",
query="Sir i want refund my fee",
))
db.commit()
result = match_department(
db,
"I have updated the syllabus. Please review the course outline.",
)
assert result == (None, 0)
finally:
engine.dispose()