def test_commit(): mock = MagicMock() with patch("subprocess.call", mock): scm = SourceControl() scm.commit("my message") mock.assert_has_calls([ call(["git.exe", "add", "-u"], env=ANY, shell=True), call(["git.exe", "commit", "-m", "my message"], env=ANY, shell=True) ])
def test_commit(): mock = MagicMock() with patch("subprocess.call", mock): scm = SourceControl() scm.commit("my message") mock.assert_has_calls( [ call(["git.exe", "add", "-u"], env=ANY, shell=True), call(["git.exe", "commit", "-m", "my message"], env=ANY, shell=True), ] )
def createSCM(): scm = SourceControl() scm.tag = MagicMock() scm.commit = MagicMock() return scm