MCPcopy
hub / github.com/timbrel/GitSavvy / test_local_branch

Method test_local_branch

tests/test_git_mixins.py:64–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62
63class TestGetBranchesParsing(TestGitMixinsUsage):
64 def test_local_branch(self):
65 repo = GitCommand()
66 git_output = join0(
67 [" ", "refs/heads/master", "refs/remotes/origin/master", "origin", ""]
68 + date_sha_and_subject)
69 when(repo).git("for-each-ref", ...).thenReturn(git_output)
70 when(repo).get_repo_path().thenReturn("yeah/sure")
71 actual = repo.get_branches()
72 self.assertEqual(actual, [
73 git_mixins.branches.Branch(
74 "master",
75 None,
76 "master",
77 "89b79cd737465ed308ecc00289d00a6f923f2da5",
78 "The Subject",
79 False,
80 False,
81 0,
82 git_mixins.branches.Upstream(
83 "origin", "master", "origin/master", ""
84 )
85 )
86 ])
87
88 def test_active_local_branch(self):
89 repo = GitCommand()

Callers

nothing calls this directly

Calls 6

GitCommandClass · 0.90
whenFunction · 0.90
thenReturnMethod · 0.80
gitMethod · 0.80
get_repo_pathMethod · 0.80
get_branchesMethod · 0.80

Tested by

no test coverage detected