Skip to content

Commit

Permalink
Revert changes to get_attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
snigdhas committed Aug 14, 2023
1 parent 144e44c commit 9aaffb5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/sentry/notifications/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def make_event(**kwargs):
return result


def get_attachment(response_num):
def get_attachment():
assert len(responses.calls) >= 1
data = parse_qs(responses.calls[response_num].request.body)
data = parse_qs(responses.calls[0].request.body)
assert "text" in data
assert "attachments" in data
attachments = json.loads(data["attachments"][0])
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_sends_note_notification(self):
assert isinstance(msg.alternatives[0][0], str)
assert "blah blah</p></div>" in msg.alternatives[0][0]

attachment, text = get_attachment(0)
attachment, text = get_attachment()
# check the Slack version
assert text == f"New comment by {self.name}"
assert attachment["title"] == f"{self.group.title}"
Expand Down Expand Up @@ -175,7 +175,7 @@ def test_sends_unassignment_notification(self):
assert isinstance(msg.alternatives[0][0], str)
assert f"{self.user.username}</strong> unassigned" in msg.alternatives[0][0]

attachment, text = get_attachment(0)
attachment, text = get_attachment()

assert text == f"Issue unassigned by {self.name}"
assert attachment["title"] == self.group.title
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_sends_resolution_notification(self, record_analytics):
assert isinstance(msg.alternatives[0][0], str)
assert f"{self.short_id}</a> as resolved</p>" in msg.alternatives[0][0]

attachment, text = get_attachment(0)
attachment, text = get_attachment()

assert (
text
Expand Down Expand Up @@ -262,7 +262,7 @@ def test_sends_deployment_notification(self, record_analytics):
in msg.alternatives[0][0]
)

attachment, text = get_attachment(0)
attachment, text = get_attachment()

assert (
text
Expand Down Expand Up @@ -329,7 +329,7 @@ def test_sends_regression_notification(self, record_analytics):
assert isinstance(msg.alternatives[0][0], str)
assert f"{group.qualified_short_id}</a> as a regression</p>" in msg.alternatives[0][0]

attachment, text = get_attachment(0)
attachment, text = get_attachment()

assert text == "Issue marked as regression"
assert (
Expand Down Expand Up @@ -383,7 +383,7 @@ def test_sends_resolved_in_release_notification(self, record_analytics):
f'text-decoration: none">{self.short_id}</a> as resolved in' in msg.alternatives[0][0]
)

attachment, text = get_attachment(0)
attachment, text = get_attachment()
assert text == f"Issue marked as resolved in {parsed_version} by {self.name}"
assert attachment["title"] == self.group.title
assert (
Expand Down Expand Up @@ -461,7 +461,7 @@ def test_sends_issue_notification(self, record_analytics):
assert isinstance(msg.alternatives[0][0], str)
assert "Hello world</pre>" in msg.alternatives[0][0]

attachment, text = get_attachment(1)
attachment, text = get_attachment()

assert attachment["title"] == "Hello world"
assert (
Expand Down

0 comments on commit 9aaffb5

Please sign in to comment.