1
+ """Tests for additional routers - basic endpoint availability tests."""
2
+
3
+ import pytest
4
+ from fastapi .testclient import TestClient
5
+
6
+ from template_fastapi .app import app
7
+
8
+ client = TestClient (app )
9
+
10
+
11
+ class TestChatsRouter :
12
+ """Test chats router basic functionality."""
13
+
14
+ def test_get_chat_page_exists (self ):
15
+ """Test that the chat page endpoint exists."""
16
+ response = client .get ("/chats/" )
17
+ # Should not return 404 - either 200 (success) or 500 (template issue)
18
+ assert response .status_code != 404
19
+
20
+
21
+ class TestFilesRouter :
22
+ """Test files router basic functionality."""
23
+
24
+ def test_list_files_endpoint_exists (self ):
25
+ """Test that the list files endpoint exists."""
26
+ response = client .get ("/files/" )
27
+ # Should not return 404 - may return 500 due to missing dependencies
28
+ assert response .status_code != 404
29
+
30
+ def test_get_file_info_endpoint_exists (self ):
31
+ """Test that the get file info endpoint exists."""
32
+ response = client .get ("/files/test.txt/info" )
33
+ # Should not return 404 - may return 500 due to missing file
34
+ assert response .status_code != 404
35
+
36
+
37
+ class TestFoodiesRouter :
38
+ """Test foodies router basic functionality."""
39
+
40
+ def test_list_restaurants_endpoint_exists (self ):
41
+ """Test that the list restaurants endpoint exists."""
42
+ response = client .get ("/foodies/restaurants/" )
43
+ # Should not return 404 - may return 500 due to missing dependencies
44
+ assert response .status_code != 404
45
+
46
+ def test_search_restaurants_endpoint_exists (self ):
47
+ """Test that the search restaurants endpoint exists."""
48
+ response = client .get ("/foodies/restaurants/search/?query=test" )
49
+ # Should not return 404 - may return 500 due to missing dependencies
50
+ assert response .status_code != 404
51
+
52
+ def test_find_nearby_restaurants_endpoint_exists (self ):
53
+ """Test that the find nearby restaurants endpoint exists."""
54
+ response = client .get ("/foodies/restaurants/near/?latitude=35.6762&longitude=139.6503" )
55
+ # Should not return 404 - may return 500 due to missing dependencies
56
+ assert response .status_code != 404
57
+
58
+
59
+ class TestSpeechesRouter :
60
+ """Test speeches router basic functionality."""
61
+
62
+ def test_list_transcription_jobs_endpoint_exists (self ):
63
+ """Test that the list transcription jobs endpoint exists."""
64
+ response = client .get ("/speeches/transcriptions/" )
65
+ # Should not return 404 - may return 500 due to missing dependencies
66
+ assert response .status_code != 404
67
+
68
+ def test_get_transcription_job_endpoint_exists (self ):
69
+ """Test that the get transcription job endpoint exists."""
70
+ response = client .get ("/speeches/transcriptions/test-job-id" )
71
+ # Should not return 404 - may return 500 due to missing job
72
+ assert response .status_code != 404
73
+
74
+
75
+ class TestAgentsRouter :
76
+ """Test agents router basic functionality."""
77
+
78
+ def test_langgraph_tools_endpoint_exists (self ):
79
+ """Test that the langgraph tools endpoint exists."""
80
+ response = client .get ("/agents/langgraph/tools" )
81
+ assert response .status_code == 200
82
+
83
+ def test_azure_ai_foundry_agents_endpoint_exists (self ):
84
+ """Test that the Azure AI Foundry agents endpoint exists."""
85
+ response = client .get ("/agents/azure-ai-foundry/" )
86
+ # Should not return 404 - may return 500 due to missing dependencies
87
+ assert response .status_code != 404
88
+
89
+ def test_azure_ai_foundry_threads_endpoint_exists (self ):
90
+ """Test that the Azure AI Foundry threads endpoint exists."""
91
+ response = client .get ("/agents/azure-ai-foundry/threads/" )
92
+ # Should not return 404 - may return 500 due to missing dependencies
93
+ assert response .status_code != 404
0 commit comments