Installing a new server should not clobber existing mcpServers entries.
(config_dir: Path)
| 139 | |
| 140 | |
| 141 | def test_other_servers_preserved(config_dir: Path): |
| 142 | """Installing a new server should not clobber existing mcpServers entries.""" |
| 143 | (config_dir / "claude_desktop_config.json").write_text(json.dumps({"mcpServers": {"other": {"command": "x"}}})) |
| 144 | |
| 145 | assert update_claude_config(file_spec="s.py:app", server_name="s") |
| 146 | |
| 147 | config = json.loads((config_dir / "claude_desktop_config.json").read_text()) |
| 148 | assert set(config["mcpServers"]) == {"other", "s"} |
| 149 | assert config["mcpServers"]["other"] == {"command": "x"} |
| 150 | |
| 151 | |
| 152 | def test_raises_when_config_dir_missing(monkeypatch: pytest.MonkeyPatch): |
nothing calls this directly
no test coverage detected