clear_cache removes the index directory when it exists and is a no-op otherwise.
(tmp_path: Path)
| 117 | |
| 118 | |
| 119 | def test_clear_cache(tmp_path: Path) -> None: |
| 120 | """clear_cache removes the index directory when it exists and is a no-op otherwise.""" |
| 121 | index_path = tmp_path / "index" |
| 122 | with patch("semble.cache.find_index_from_cache_folder", return_value=index_path): |
| 123 | clear_cache("/some/path") # no-op: path doesn't exist yet |
| 124 | index_path.mkdir() |
| 125 | with patch("semble.cache.find_index_from_cache_folder", return_value=index_path): |
| 126 | clear_cache("/some/path") |
| 127 | assert not index_path.exists() |
| 128 | |
| 129 | |
| 130 | def _write_metadata( |
nothing calls this directly
no test coverage detected