def test_no_tag(): scm = Scm('/foo') scm._git = MagicMock(side_effect=ProcessExecutionError([], 1, '!', '!')) assert scm.tag == None
def test_branch(): scm = Scm('/foo') scm._git = MagicMock(return_value='master') assert scm.branch == 'master'
def test_some_tag(): scm = Scm('/foo') scm._git = MagicMock(return_value='v1.2') assert scm.tag == 'v1.2'
def setup_last_commit_scm(): scm = Scm('/foo') git_result = '0101beef\n1386816309\nJohn Doe\nFix bugs' scm._git = MagicMock(return_value=git_result) return scm
def test_no_tag(): scm = Scm("/foo") scm._git = MagicMock(side_effect=ProcessExecutionError([], 1, "!", "!")) assert scm.tag == None
def test_some_tag(): scm = Scm("/foo") scm._git = MagicMock(return_value="v1.2") assert scm.tag == "v1.2"
def test_branch(): scm = Scm("/foo") scm._git = MagicMock(return_value="master") assert scm.branch == "master"
def setup_last_commit_scm(): scm = Scm("/foo") git_result = "0101beef\n1386816309\nJohn Doe\nFix bugs" scm._git = MagicMock(return_value=git_result) return scm