(testrepo: Repository)
| 179 | |
| 180 | |
| 181 | def test_create_branch(testrepo: Repository) -> None: |
| 182 | commit = testrepo[LAST_COMMIT] |
| 183 | assert isinstance(commit, Commit) |
| 184 | testrepo.create_branch('version1', commit) |
| 185 | refs = testrepo.listall_branches() |
| 186 | assert 'version1' in refs |
| 187 | assert testrepo.lookup_branch('version1').target == LAST_COMMIT |
| 188 | assert testrepo.lookup_branch(b'version1').target == LAST_COMMIT |
| 189 | |
| 190 | # try to create existing reference |
| 191 | with pytest.raises(ValueError): |
| 192 | testrepo.create_branch('version1', commit) |
| 193 | |
| 194 | # try to create existing reference with force |
| 195 | assert testrepo.create_branch('version1', commit, True).target == LAST_COMMIT |
| 196 | |
| 197 | |
| 198 | def test_delete(testrepo: Repository) -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…