_run_clear('savings') deletes the file when present, reports missing otherwise.
(
create_file: bool, expected: str, tmp_path: Path, capsys: pytest.CaptureFixture[str]
)
| 288 | ], |
| 289 | ) |
| 290 | def test_run_clear_savings( |
| 291 | create_file: bool, expected: str, tmp_path: Path, capsys: pytest.CaptureFixture[str] |
| 292 | ) -> None: |
| 293 | """_run_clear('savings') deletes the file when present, reports missing otherwise.""" |
| 294 | savings_file = tmp_path / "savings.jsonl" |
| 295 | if create_file: |
| 296 | savings_file.write_text('{"tokens": 100}\n') |
| 297 | |
| 298 | with patch("semble.cli.resolve_cache_folder", return_value=tmp_path): |
| 299 | _run_clear("savings") |
| 300 | |
| 301 | if create_file: |
| 302 | assert not savings_file.exists() |
| 303 | out = capsys.readouterr().out |
| 304 | assert expected in out |
| 305 | |
| 306 | |
| 307 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected