MCPcopy
hub / github.com/pallets/click / test_editor_windows_path_normalization

Function test_editor_windows_path_normalization

tests/test_termui.py:538–547  ·  view source on GitHub ↗

Windows-specific tests: verify ``Popen`` receives unquoted paths that ``subprocess.list2cmdline`` can re-quote for ``CreateProcess``.

(editor_cmd, expected_cmd)

Source from the content-addressed store, hash-verified

536 ],
537)
538def test_editor_windows_path_normalization(editor_cmd, expected_cmd):
539 """Windows-specific tests: verify ``Popen`` receives unquoted paths that
540 ``subprocess.list2cmdline`` can re-quote for ``CreateProcess``."""
541 with patch("subprocess.Popen") as mock_popen:
542 mock_popen.return_value.wait.return_value = 0
543 Editor(editor=editor_cmd).edit_files(["f.txt"])
544
545 args = mock_popen.call_args[1].get("args") or mock_popen.call_args[0][0]
546 assert args == expected_cmd + ["f.txt"]
547 assert mock_popen.call_args[1].get("shell") is None
548
549
550def test_editor_env_passed_through():

Callers

nothing calls this directly

Calls 2

EditorClass · 0.90
edit_filesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…