def test_fail(self, check_output): check_output.side_effect = CalledProcessError(None, None) self.assertEqual(scm.get_git_rev(), None)
def test_ok(self, check_output): check_output.return_value = "abcdefgh\n" self.assertEqual(scm.get_git_rev(), "abcdefgh")