Create a fake valid index directory with the expected structure.
(cache_folder: Path, sha: str = "a" * 64)
| 230 | |
| 231 | |
| 232 | def _make_valid_index_dir(cache_folder: Path, sha: str = "a" * 64) -> Path: |
| 233 | """Create a fake valid index directory with the expected structure.""" |
| 234 | index_dir = cache_folder / sha / "index" |
| 235 | index_dir.mkdir(parents=True) |
| 236 | # Create the files that PersistencePath.non_existing checks |
| 237 | (index_dir / "chunks.json").write_text("[]") |
| 238 | (index_dir / "bm25_index").write_text("") |
| 239 | (index_dir / "semantic_index").write_text("") |
| 240 | (index_dir / "metadata.json").write_text("{}") |
| 241 | return index_dir |
| 242 | |
| 243 | |
| 244 | @pytest.mark.parametrize( |
no outgoing calls
no test coverage detected