Skip to content

Commit

Permalink
add test for unmerge metric
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Jul 14, 2023
1 parent 3fe67f6 commit 4c1d292
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/sentry/api/endpoints/test_group_hashes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
from unittest.mock import patch
from urllib.parse import urlencode

from sentry.eventstream.snuba import SnubaEventStream
Expand Down Expand Up @@ -94,7 +95,7 @@ def test_return_multiple_hashes(self):
def test_unmerge(self):
self.login_as(user=self.user)

group = self.create_group()
group = self.create_group(platform="javascript")

hashes = [
GroupHash.objects.create(project=group.project, group=group, hash=hash)
Expand All @@ -108,5 +109,12 @@ def test_unmerge(self):
]
)

response = self.client.delete(url, format="json")
assert response.status_code == 202, response.content
with patch("sentry.api.endpoints.group_hashes.metrics.incr") as mock_metrics_incr:
response = self.client.delete(url, format="json")

assert response.status_code == 202, response.content
mock_metrics_incr.assert_any_call(
"grouping.unmerge_issues",
sample_rate=1.0,
tags={"platform": "javascript"},
)

0 comments on commit 4c1d292

Please sign in to comment.