Test that URL-based config without url is rejected.
()
| 261 | |
| 262 | @pytest.mark.asyncio |
| 263 | async def test_url_config_validation(): |
| 264 | """Test that URL-based config without url is rejected.""" |
| 265 | with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f: |
| 266 | config = { |
| 267 | "mcpServers": { |
| 268 | "broken-sse": { |
| 269 | "type": "sse", |
| 270 | # Missing "url" field |
| 271 | } |
| 272 | } |
| 273 | } |
| 274 | json.dump(config, f) |
| 275 | f.flush() |
| 276 | |
| 277 | try: |
| 278 | tools = await load_mcp_tools_async(f.name) |
| 279 | # Should return empty list (server skipped due to missing url) |
| 280 | assert tools == [] |
| 281 | finally: |
| 282 | await cleanup_mcp_connections() |
| 283 | Path(f.name).unlink() |
| 284 | |
| 285 | |
| 286 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected