コード例 #1
0
 def test_ahead_1_commit(self) -> None:
     status = Status(self.dummy_path)
     status.branch = "master"
     status.ahead = 1
     # fmt: off
     assert status.describe() == [
         ui.green, "master", ui.reset, ui.blue, f"{UP}1 commit", ui.reset
     ]
コード例 #2
0
ファイル: test_git_status.py プロジェクト: xzr/tsrc
 def test_diverged(self) -> None:
     status = Status(self.dummy_path)
     status.branch = "master"
     status.ahead = 1
     status.behind = 2
     # fmt: off
     assert status.describe() == [
         ui.green, "master", ui.reset,
         ui.blue, f"{UP}1 commit", ui.reset,
         ui.blue, f"{DOWN}2 commits", ui.reset,
     ]
コード例 #3
0
 def test_on_tag(self) -> None:
     status = Status(self.dummy_path)
     status.tag = "v0.1"
     assert status.describe() == [ui.yellow, "on", "v0.1", ui.reset]
コード例 #4
0
 def test_on_sha1(self) -> None:
     status = Status(self.dummy_path)
     status.sha1 = "b6cfd80"
     assert status.describe() == [ui.red, "b6cfd80", ui.reset]
コード例 #5
0
 def get_status(self) -> Status:
     status = Status(self.path)
     status.update()
     return status
コード例 #6
0
 def test_up_to_date(self) -> None:
     status = Status(self.dummy_path)
     status.branch = "master"
     assert status.describe() == [ui.green, "master", ui.reset]