MCPcopy Create free account
hub / github.com/libgit2/pygit2 / test_refs_create_symbolic

Function test_refs_create_symbolic

test/test_refs.py:247–265  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

245
246
247def test_refs_create_symbolic(testrepo: Repository) -> None:
248 # We add a tag as a new symbolic reference that always points to
249 # "refs/heads/master"
250 reference = testrepo.references.create('refs/tags/beta', 'refs/heads/master')
251 assert reference.type == ReferenceType.SYMBOLIC
252 assert reference.target == 'refs/heads/master'
253 assert reference.raw_target == b'refs/heads/master'
254
255 # try to create existing symbolic reference
256 with pytest.raises(ValueError):
257 testrepo.references.create('refs/tags/beta', 'refs/heads/master')
258
259 # try to create existing symbolic reference with force
260 reference = testrepo.references.create(
261 'refs/tags/beta', 'refs/heads/master', force=True
262 )
263 assert reference.type == ReferenceType.SYMBOLIC
264 assert reference.target == 'refs/heads/master'
265 assert reference.raw_target == b'refs/heads/master'
266
267
268# def test_packall_references(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…