diff --git a/tests/test_progit_lib.py b/tests/test_progit_lib.py index 205cef7..b463e7b 100644 --- a/tests/test_progit_lib.py +++ b/tests/test_progit_lib.py @@ -1343,6 +1343,26 @@ class ProgitLibtests(tests.Modeltests): self.assertEqual(issue_blocked.parents, []) self.assertEqual(issue_blocked.children, []) + @patch('progit.lib.git.update_git') + @patch('progit.lib.notify.send_email') + def test_get_issue_comment(self, p_send_email, p_ugt): + """ Test the get_issue_comment of progit.lib. """ + p_send_email.return_value = True + p_ugt.return_value = True + + self.test_add_issue_comment() + + repo = progit.lib.get_project(self.session, 'test') + issue = progit.lib.search_issues(self.session, repo, issueid=1) + + self.assertEqual( + progit.lib.get_issue_comment(self.session, issue.uid, 10), + None + ) + + comment = progit.lib.get_issue_comment(self.session, issue.uid, 1) + self.assertEqual(comment.comment, 'Hey look a comment!') + if __name__ == '__main__': SUITE = unittest.TestLoader().loadTestsFromTestCase(ProgitLibtests)