1111 _get_linux_config_home ,
1212 _get_mcp_servers_dict ,
1313 _get_python_executable ,
14+ _iter_wireshark_search_dirs ,
15+ _join_path ,
1416 _read_json_config ,
1517 _render_codex_toml_block ,
1618 _write_json_config ,
@@ -276,10 +278,35 @@ def test_uninstall_removes_codex_toml_block(self, tmp_path):
276278
277279
278280class TestPlatformConfigs :
281+ def test_join_path_uses_target_platform_separators (self ):
282+ assert _join_path ("/Users/tester" , "Library" , "Claude" ) == "/Users/tester/Library/Claude"
283+ assert (
284+ _join_path (r"C:\Users\tester" , "AppData" , "Roaming" , platform = "win32" ) == r"C:\Users\tester\AppData\Roaming"
285+ )
286+
279287 def test_linux_config_home_uses_xdg (self , monkeypatch ):
280288 monkeypatch .setenv ("XDG_CONFIG_HOME" , "/tmp/xdg-config" )
281289 assert _get_linux_config_home ("/home/tester" ) == "/tmp/xdg-config"
282290
291+ def test_mac_client_configs_use_application_support (self , monkeypatch ):
292+ monkeypatch .setattr ("wireshark_mcp.installer.sys.platform" , "darwin" )
293+ monkeypatch .setattr ("wireshark_mcp.installer.os.path.expanduser" , lambda _ : "/Users/tester" )
294+
295+ configs = _get_client_configs ()
296+
297+ assert configs ["Claude" ] == (
298+ "/Users/tester/Library/Application Support/Claude" ,
299+ "claude_desktop_config.json" ,
300+ )
301+ assert configs ["Zed" ] == (
302+ "/Users/tester/Library/Application Support/Zed" ,
303+ "settings.json" ,
304+ )
305+ assert configs ["VS Code" ] == (
306+ "/Users/tester/Library/Application Support/Code/User" ,
307+ "settings.json" ,
308+ )
309+
283310 def test_linux_client_configs_use_xdg (self , monkeypatch ):
284311 monkeypatch .setattr ("wireshark_mcp.installer.sys.platform" , "linux" )
285312 monkeypatch .setattr ("wireshark_mcp.installer.os.path.expanduser" , lambda _ : "/home/tester" )
@@ -306,3 +333,27 @@ def test_windows_client_configs_include_supported_paths(self, monkeypatch):
306333 r"C:\Users\tester\AppData\Roaming\Code\User" ,
307334 "settings.json" ,
308335 )
336+
337+ def test_iter_wireshark_search_dirs_for_macos (self , monkeypatch ):
338+ monkeypatch .setattr ("wireshark_mcp.installer.sys.platform" , "darwin" )
339+ monkeypatch .setattr ("wireshark_mcp.installer.os.path.expanduser" , lambda _ : "/Users/tester" )
340+
341+ search_dirs = _iter_wireshark_search_dirs ()
342+
343+ assert "/Applications/Wireshark.app/Contents/MacOS" in search_dirs
344+ assert "/Applications/Wireshark.app/Contents/Helpers" in search_dirs
345+ assert "/Users/tester/Applications/Wireshark.app/Contents/MacOS" in search_dirs
346+ assert "/opt/homebrew/bin" in search_dirs
347+
348+ def test_iter_wireshark_search_dirs_for_windows (self , monkeypatch ):
349+ monkeypatch .setattr ("wireshark_mcp.installer.sys.platform" , "win32" )
350+ monkeypatch .setattr ("wireshark_mcp.installer.os.path.expanduser" , lambda _ : r"C:\Users\tester" )
351+ monkeypatch .setenv ("LOCALAPPDATA" , r"C:\Users\tester\AppData\Local" )
352+ monkeypatch .setenv ("PROGRAMFILES" , r"C:\Program Files" )
353+ monkeypatch .setenv ("PROGRAMFILES(X86)" , r"C:\Program Files (x86)" )
354+
355+ search_dirs = _iter_wireshark_search_dirs ()
356+
357+ assert r"C:\Program Files\Wireshark" in search_dirs
358+ assert r"C:\Program Files (x86)\Wireshark" in search_dirs
359+ assert r"C:\Users\tester\AppData\Local\Programs\Wireshark" in search_dirs
0 commit comments