MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_process_options_http_server

Function test_process_options_http_server

tests/config/test_cli_options.py:285–319  ·  view source on GitHub ↗

Test handling of HTTP server configuration.

(mock_discovery, monkeypatch, tmp_path)

Source from the content-addressed store, hash-verified

283
284@patch("mcp_cli.config.cli_options.trigger_discovery_after_setup")
285def test_process_options_http_server(mock_discovery, monkeypatch, tmp_path):
286 """Test handling of HTTP server configuration."""
287 mock_discovery.return_value = 0
288
289 server_input = "HttpServer"
290 provider = "openai"
291 model = "gpt-5"
292
293 # Create config with HTTP server (has url instead of command)
294 config_content = {
295 "mcpServers": {
296 "HttpServer": {
297 "url": "http://localhost:8080" # HTTP server config
298 }
299 }
300 }
301 config_file = tmp_path / "http_config.json"
302 config_file.write_text(json.dumps(config_content))
303
304 monkeypatch.delenv("LLM_PROVIDER", raising=False)
305 monkeypatch.delenv("LLM_MODEL", raising=False)
306
307 servers_list, user_specified, server_names = process_options(
308 server=server_input,
309 disable_filesystem=True,
310 provider=provider,
311 model=model,
312 config_file=str(config_file),
313 )
314
315 # Verify HTTP server was properly detected and processed
316 assert servers_list == ["HttpServer"]
317 assert server_names == {0: "HttpServer"}
318 assert os.environ["LLM_PROVIDER"] == "openai"
319 assert os.environ["LLM_MODEL"] == "gpt-5"
320
321
322@pytest.mark.skip(reason="Config modification removed - configs are now immutable")

Callers

nothing calls this directly

Calls 1

process_optionsFunction · 0.90

Tested by

no test coverage detected