Test that config manager follows singleton pattern.
(tmp_path)
| 102 | |
| 103 | @pytest.mark.asyncio |
| 104 | async def test_config_singleton_pattern(tmp_path): |
| 105 | """Test that config manager follows singleton pattern.""" |
| 106 | config_data = {"mcpServers": {"Server1": {"command": "cmd1"}}} |
| 107 | config_file = tmp_path / "config.json" |
| 108 | config_file.write_text(json.dumps(config_data)) |
| 109 | |
| 110 | # Reset the singleton first |
| 111 | ConfigManager._instance = None |
| 112 | |
| 113 | # Initialize config |
| 114 | config1 = initialize_config(config_file) |
| 115 | |
| 116 | # Get config should return the same instance |
| 117 | config2 = get_config() |
| 118 | |
| 119 | # Should be the same object |
| 120 | assert config1 is config2 |
| 121 | assert config1.servers == config2.servers |
nothing calls this directly
no test coverage detected