Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgundy committed Dec 9, 2024
1 parent 8be8f54 commit 717e8de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions reusable_workflows/tests/test_cla_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from shared.messages import (
AGREED_MESSAGE,
CLA_AGREEMENT_MESSAGE,
FAILED_COMMENT,
USER_AGREEMENT_MESSAGE,
)
from check_cla.check_cla_pr import CLAHandler, main
Expand Down Expand Up @@ -52,6 +53,17 @@ def test_no_bot_comment():
assert bot_comment is False


def test_leave_failed_comment_on_issue():
cla = CLAHandler(mock.Mock())
issue = mock.Mock()
issue.comments.return_value = mock.Mock()
cla.check_if_comment_already_exists = mock.Mock(return_value=False)

cla.leave_failed_comment_on_issue(issue)

issue.create_comment.assert_called_once_with(FAILED_COMMENT)


def test_cla_is_signed(capfd):
cla = CLAHandler(mock.Mock())
issue = mock.Mock()
Expand Down

0 comments on commit 717e8de

Please sign in to comment.