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

Function test_run_clear_savings

tests/test_cli.py:290–304  ·  view source on GitHub ↗

_run_clear('savings') deletes the file when present, reports missing otherwise.

(
    create_file: bool, expected: str, tmp_path: Path, capsys: pytest.CaptureFixture[str]
)

Source from the content-addressed store, hash-verified

288 ],
289)
290def 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(

Callers

nothing calls this directly

Calls 1

_run_clearFunction · 0.90

Tested by

no test coverage detected