@@ -13,10 +13,6 @@ def test_default_configuration(simple_fastapi_app: FastAPI):
1313 assert mcp_server .name == simple_fastapi_app .title
1414 assert mcp_server .description == simple_fastapi_app .description
1515
16- # Check default base URL
17- assert mcp_server ._base_url is not None
18- assert mcp_server ._base_url .startswith ("http://" )
19-
2016 # Check default options
2117 assert mcp_server ._describe_all_responses is False
2218 assert mcp_server ._describe_full_response_schema is False
@@ -27,13 +23,11 @@ def test_custom_configuration(simple_fastapi_app: FastAPI):
2723 # Create MCP server with custom options
2824 custom_name = "Custom MCP Server"
2925 custom_description = "A custom MCP server for testing"
30- custom_base_url = "https://custom-api.example.com"
3126
3227 mcp_server = FastApiMCP (
3328 simple_fastapi_app ,
3429 name = custom_name ,
3530 description = custom_description ,
36- base_url = custom_base_url ,
3731 describe_all_responses = True ,
3832 describe_full_response_schema = True ,
3933 )
@@ -42,41 +36,19 @@ def test_custom_configuration(simple_fastapi_app: FastAPI):
4236 assert mcp_server .name == custom_name
4337 assert mcp_server .description == custom_description
4438
45- # Check custom base URL
46- assert mcp_server ._base_url == custom_base_url
47-
4839 # Check custom options
4940 assert mcp_server ._describe_all_responses is True
5041 assert mcp_server ._describe_full_response_schema is True
5142
5243
53- def test_base_url_normalization (simple_fastapi_app : FastAPI ):
54- """Test that base URLs are normalized correctly."""
55- # Test with trailing slash
56- mcp_server1 = FastApiMCP (
57- simple_fastapi_app ,
58- base_url = "http://example.com/api/" ,
59- )
60- assert mcp_server1 ._base_url == "http://example.com/api"
61-
62- # Test without trailing slash
63- mcp_server2 = FastApiMCP (
64- simple_fastapi_app ,
65- base_url = "http://example.com/api" ,
66- )
67- assert mcp_server2 ._base_url == "http://example.com/api"
68-
69-
7044def test_describe_all_responses_config_simple_app (simple_fastapi_app : FastAPI ):
7145 """Test the describe_all_responses behavior with the simple app."""
7246 mcp_default = FastApiMCP (
7347 simple_fastapi_app ,
74- base_url = "http://example.com" ,
7548 )
7649
7750 mcp_all_responses = FastApiMCP (
7851 simple_fastapi_app ,
79- base_url = "http://example.com" ,
8052 describe_all_responses = True ,
8153 )
8254
@@ -136,7 +108,6 @@ def test_describe_full_response_schema_config_simple_app(simple_fastapi_app: Fas
136108
137109 mcp_full_response_schema = FastApiMCP (
138110 simple_fastapi_app ,
139- base_url = "http://example.com" ,
140111 describe_full_response_schema = True ,
141112 )
142113
@@ -170,7 +141,6 @@ def test_describe_all_responses_and_full_response_schema_config_simple_app(simpl
170141
171142 mcp_all_responses_and_full_response_schema = FastApiMCP (
172143 simple_fastapi_app ,
173- base_url = "http://example.com" ,
174144 describe_all_responses = True ,
175145 describe_full_response_schema = True ,
176146 )
@@ -208,12 +178,10 @@ def test_describe_all_responses_config_complex_app(complex_fastapi_app: FastAPI)
208178 """Test the describe_all_responses behavior with the complex app."""
209179 mcp_default = FastApiMCP (
210180 complex_fastapi_app ,
211- base_url = "http://example.com" ,
212181 )
213182
214183 mcp_all_responses = FastApiMCP (
215184 complex_fastapi_app ,
216- base_url = "http://example.com" ,
217185 describe_all_responses = True ,
218186 )
219187
@@ -281,7 +249,6 @@ def test_describe_full_response_schema_config_complex_app(complex_fastapi_app: F
281249 """Test the describe_full_response_schema behavior with the complex app."""
282250 mcp_full_response_schema = FastApiMCP (
283251 complex_fastapi_app ,
284- base_url = "http://example.com" ,
285252 describe_full_response_schema = True ,
286253 )
287254
@@ -326,7 +293,6 @@ def test_describe_all_responses_and_full_response_schema_config_complex_app(comp
326293 """Test the describe_all_responses and describe_full_response_schema together with the complex app."""
327294 mcp_all_responses_and_full_schema = FastApiMCP (
328295 complex_fastapi_app ,
329- base_url = "http://example.com" ,
330296 describe_all_responses = True ,
331297 describe_full_response_schema = True ,
332298 )
0 commit comments