Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update tests now that we don't post the survey link #301

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions tests/test_pull_request_closed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from openedx_webhooks.bot_comments import (
BotComment,
is_comment_kind,
)
from openedx_webhooks.cla_check import (
CLA_CONTEXT,
Expand Down Expand Up @@ -52,16 +51,6 @@ def closed_pull_request(is_merged, fake_github, fake_jira):
return pr


def test_external_pr_closed(fake_jira, closed_pull_request):
pr = closed_pull_request
pull_request_changed(pr.as_json())

pr_comments = pr.list_comments()
body = pr_comments[-1].body
assert "survey" in body
assert is_comment_kind(BotComment.SURVEY, body)


def test_external_pr_closed_but_issue_deleted(fake_jira, closed_pull_request):
# A closing pull request, but its Jira issue has been deleted.
pr = closed_pull_request
Expand All @@ -70,7 +59,7 @@ def test_external_pr_closed_but_issue_deleted(fake_jira, closed_pull_request):
assert not result.jira_issues

pr_comments = pr.list_comments()
assert len(pr_comments) == 4 # 1 welcome, closed_pull_request makes two, 1 survey
assert len(pr_comments) == 3 # 1 welcome, closed_pull_request makes two
# We leave the old issue id in the comment.
body = pr_comments[0].body
check_issue_link_in_markdown(body, None)
Expand Down Expand Up @@ -98,13 +87,13 @@ def test_cc_pr_closed(fake_github, fake_jira, is_merged):
pull_request_changed(pr.as_json())

pr_comments = pr.list_comments()
assert len(pr_comments) == 2 # 1 welcome, 1 survey
assert len(pr_comments) == 1 # welcome comment

# Processing it again won't change anything.
pull_request_changed(pr.as_json())

pr_comments = pr.list_comments()
assert len(pr_comments) == 2 # 1 welcome, 1 survey
assert len(pr_comments) == 1 # welcome comment


@pytest.mark.parametrize("org", ["openedx", "edx"])
Expand Down
1 change: 0 additions & 1 deletion tests/test_rescan.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def test_rescan_repository_dry_run(rescannable_repo, fake_github, fake_jira, pul
],
108: [
"initial_state",
"add_comment_to_pull_request", # "Even though your pull request wasn't merged"
],
110: [
"initial_state",
Expand Down
Loading