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

Function test_branches_upstream

test/test_branch_empty.py:59–76  ·  view source on GitHub ↗
(repo: Repository)

Source from the content-addressed store, hash-verified

57
58
59def test_branches_upstream(repo: Repository) -> None:
60 remote_master = repo.branches.remote['origin/master']
61 commit = repo[remote_master.target]
62 assert isinstance(commit, Commit)
63 master = repo.branches.create('master', commit)
64
65 assert master.upstream is None
66 master.upstream = remote_master
67 assert master.upstream.branch_name == 'origin/master'
68
69 def set_bad_upstream():
70 master.upstream = 2.5
71
72 with pytest.raises(TypeError):
73 set_bad_upstream()
74
75 master.upstream = None
76 assert master.upstream is None
77
78
79def test_branches_upstream_name(repo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

set_bad_upstreamFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…