ai-engineering-project / tests /test_chat_source.py
GitHub Action
Clean deployment without binary files
f884e6e
# tests use the pytest 'client' fixture; no direct app import required
def test_chat_source_handles_none_and_unsafe(client):
# Test that chat_source returns 404 for unknown source and does not raise
response = client.get("/chat/source/unknown_file.md")
assert response.status_code in (200, 404)
def test_chat_source_safe_logging(client):
# Ensure requesting a known sample filename returns success and logger doesn't error
response = client.get("/chat/source/remote_work_policy.md")
data = response.get_json()
assert data is not None
assert data.get("status") in ("success", "error")