MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_path_complete_users_windows

Function test_path_complete_users_windows

tests/test_cmd2.py:4261–4270  ·  view source on GitHub ↗
(monkeypatch, base_app)

Source from the content-addressed store, hash-verified

4259 reason="This tests how Cmd._complete_users() behaves on Windows.",
4260)
4261def test_path_complete_users_windows(monkeypatch, base_app):
4262 # Mock os.path.expanduser and isdir
4263 monkeypatch.setattr("os.path.expanduser", lambda p: "/home/user" if p == "~user" else p)
4264 monkeypatch.setattr("os.path.isdir", lambda p: p == "/home/user")
4265
4266 matches = base_app.path_complete("~user", "cmd ~user", 0, 9)
4267 # Should contain ~user/ (or ~user\ depending on sep)
4268 # Since we didn't mock os.path.sep, it will use system separator.
4269 expected = "~user" + os.path.sep
4270 assert expected in matches
4271
4272
4273def test_get_bottom_toolbar(base_app, monkeypatch):

Callers

nothing calls this directly

Calls 1

path_completeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…