MCPcopy
hub / github.com/MinishLab/semble / test_cli_path_not_found

Function test_cli_path_not_found

tests/test_cli.py:158–167  ·  view source on GitHub ↗

index, search, and find-related exit 1 with a friendly message when the path does not exist.

(
    command: str, argv: list[str], monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
)

Source from the content-addressed store, hash-verified

156 ],
157)
158def test_cli_path_not_found(
159 command: str, argv: list[str], monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
160) -> None:
161 """index, search, and find-related exit 1 with a friendly message when the path does not exist."""
162 monkeypatch.setattr(sys, "argv", argv)
163 with patch("semble.cli._build_index", side_effect=FileNotFoundError("Path does not exist: /no/such/path")):
164 with pytest.raises(SystemExit) as exc_info:
165 _cli_main()
166 assert exc_info.value.code == 1
167 assert "Path does not exist" in capsys.readouterr().err
168
169
170def test_include_text_files_cli_deprecated(

Callers

nothing calls this directly

Calls 1

_cli_mainFunction · 0.90

Tested by

no test coverage detected