(store, tempdir_factory, caplog)
| 80 | |
| 81 | |
| 82 | def test_clone(store, tempdir_factory, caplog): |
| 83 | path = git_dir(tempdir_factory) |
| 84 | with cwd(path): |
| 85 | git_commit() |
| 86 | rev = git.head_rev(path) |
| 87 | git_commit() |
| 88 | |
| 89 | ret = store.clone(path, rev) |
| 90 | # Should have printed some stuff |
| 91 | assert caplog.record_tuples[0][-1].startswith( |
| 92 | 'Initializing environment for ', |
| 93 | ) |
| 94 | |
| 95 | # Should return a directory inside of the store |
| 96 | assert os.path.exists(ret) |
| 97 | assert ret.startswith(store.directory) |
| 98 | # Directory should start with `repo` |
| 99 | _, dirname = os.path.split(ret) |
| 100 | assert dirname.startswith('repo') |
| 101 | # Should be checked out to the rev we specified |
| 102 | assert git.head_rev(ret) == rev |
| 103 | |
| 104 | # Assert there's an entry in the sqlite db for this |
| 105 | assert _select_all_repos(store) == [(path, rev, ret)] |
| 106 | |
| 107 | |
| 108 | def test_warning_for_deprecated_stages_on_init(store, tempdir_factory, caplog): |
nothing calls this directly
no test coverage detected