Download tests/test_routing.py from Noor2623/Smart-Query-Routing-Email-Automation-System: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/Noor2623/Smart-Query-Routing-Email-Automation-System/resolve/main/tests/test_routing.py
- Command line
-
hf download hf://spaces/Noor2623/Smart-Query-Routing-Email-Automation-System/tests/test_routing.py
-
curl -L -o test_routing.py https://huggingface.co/spaces/Noor2623/Smart-Query-Routing-Email-Automation-System/resolve/main/tests/test_routing.py
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 | |
| 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() | |