(barerepo: Repository)
| 143 | |
| 144 | |
| 145 | def test_lookup_commit_prefix(barerepo: Repository) -> None: |
| 146 | commit_sha = '5fe808e8953c12735680c257f56600cb0de44b10' |
| 147 | commit_sha_prefix = commit_sha[:7] |
| 148 | too_short_prefix = commit_sha[:3] |
| 149 | commit = barerepo[commit_sha_prefix] |
| 150 | assert commit_sha == commit.id |
| 151 | assert int(ObjectType.COMMIT) == commit.type |
| 152 | assert isinstance(commit, Commit) |
| 153 | assert ( |
| 154 | 'Second test data commit.\n\n' |
| 155 | 'This commit has some additional text.\n' == commit.message |
| 156 | ) |
| 157 | with pytest.raises(ValueError): |
| 158 | barerepo.__getitem__(too_short_prefix) |
| 159 | |
| 160 | |
| 161 | def test_expand_id(barerepo: Repository) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…