(tempdir_factory, store, in_git_dir, cap_out)
| 146 | |
| 147 | |
| 148 | def test_invalid_manifest_gcd(tempdir_factory, store, in_git_dir, cap_out): |
| 149 | # clean up repos from old pre-commit versions |
| 150 | path = make_repo(tempdir_factory, 'script_hooks_repo') |
| 151 | write_config('.', make_config_from_repo(path)) |
| 152 | store.mark_config_used(C.CONFIG_FILE) |
| 153 | |
| 154 | # trigger a clone |
| 155 | install_hooks(C.CONFIG_FILE, store) |
| 156 | |
| 157 | # we'll "break" the manifest to simulate an old version clone |
| 158 | with store.connect() as db: |
| 159 | path, = db.execute('SELECT path FROM repos').fetchone() |
| 160 | os.remove(os.path.join(path, C.MANIFEST_FILE)) |
| 161 | |
| 162 | assert _config_count(store) == 1 |
| 163 | assert _repo_count(store) == 1 |
| 164 | assert not gc(store) |
| 165 | assert _config_count(store) == 1 |
| 166 | assert _repo_count(store) == 0 |
| 167 | assert cap_out.get().splitlines()[-1] == '1 repo(s) removed.' |
| 168 | |
| 169 | |
| 170 | def test_gc_pre_1_14_roll_forward(store, cap_out): |
nothing calls this directly
no test coverage detected