--content parses into the right ContentType list (including the 'all' shorthand and default).
(
argv_content: list[str],
expected: list[ContentType],
monkeypatch: pytest.MonkeyPatch,
)
| 196 | ], |
| 197 | ) |
| 198 | def test_cli_content_argument( |
| 199 | argv_content: list[str], |
| 200 | expected: list[ContentType], |
| 201 | monkeypatch: pytest.MonkeyPatch, |
| 202 | ) -> None: |
| 203 | """--content parses into the right ContentType list (including the 'all' shorthand and default).""" |
| 204 | chunk = make_chunk("def foo(): pass", "src/foo.py") |
| 205 | fake_index = MagicMock() |
| 206 | fake_index.search.return_value = [SearchResult(chunk=chunk, score=0.9)] |
| 207 | monkeypatch.setattr(sys, "argv", ["semble", "search", "query", "/some/path", *argv_content]) |
| 208 | with patch("semble.cli.SembleIndex.from_path", return_value=fake_index) as mock_from_path: |
| 209 | _cli_main() |
| 210 | assert list(mock_from_path.call_args.kwargs["content"]) == expected |
| 211 | |
| 212 | |
| 213 | def test_maybe_save_index_logs_error_on_save_failure(capsys: pytest.CaptureFixture[str]) -> None: |
nothing calls this directly
no test coverage detected