Skip to content

Commit

Permalink
chore(similarity): Add task call assertion to delete test (#73790)
Browse files Browse the repository at this point in the history
Add task assertion to delete record by hash test
  • Loading branch information
jangjodi authored Jul 8, 2024
1 parent ec9d28b commit f200390
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/sentry/api/helpers/test_group_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,9 +1086,14 @@ def test_delete_groups_simple(self, send_robust: Mock):
assert send_robust.called

@with_feature("projects:similarity-embeddings-delete-by-hash")
@patch(
"sentry.tasks.delete_seer_grouping_records.delete_seer_grouping_records_by_hash.apply_async"
)
@patch("sentry.tasks.delete_seer_grouping_records.logger")
@patch("sentry.signals.issue_deleted.send_robust")
def test_delete_groups_deletes_seer_records_by_hash(self, send_robust: Mock, mock_logger: Mock):
def test_delete_groups_deletes_seer_records_by_hash(
self, send_robust: Mock, mock_logger: Mock, mock_delete_seer_grouping_records_by_hash
):
groups = [self.create_group(), self.create_group()]
group_ids = [group.id for group in groups]
request = self.make_request(user=self.user, method="GET")
Expand All @@ -1115,3 +1120,6 @@ def test_delete_groups_deletes_seer_records_by_hash(self, send_robust: Mock, moc
"calling seer record deletion by hash",
extra={"project_id": self.project.id, "hashes": hashes},
)
mock_delete_seer_grouping_records_by_hash.assert_called_with(
args=[self.project.id, hashes, 0]
)

0 comments on commit f200390

Please sign in to comment.