Skip to content

Commit

Permalink
ref: assert whatever.called_with is not a thing (#76636)
Browse files Browse the repository at this point in the history
<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry committed Aug 27, 2024
1 parent 61ae2f4 commit c233112
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/sentry/incidents/test_subscription_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,8 @@ def test_seer_call_bad_status(self, mock_logger, mock_seer_request):
processor = SubscriptionProcessor(self.sub)
mock_seer_request.return_value = HTTPResponse("You flew too close to the sun", status=403)
result = processor.get_anomaly_data_from_seer(10)
assert mock_logger.error.called_with(
f"Received 403 when calling Seer endpoint {SEER_ANOMALY_DETECTION_ENDPOINT_URL}.", # noqa
mock_logger.error.assert_called_with(
f"Received 403 when calling Seer endpoint {SEER_ANOMALY_DETECTION_ENDPOINT_URL}.",
extra={"response_data": "You flew too close to the sun"},
)
assert result is None
Expand All @@ -852,7 +852,9 @@ def test_seer_call_failed_parse(self, mock_logger, mock_seer_request):
processor = SubscriptionProcessor(self.sub)
mock_seer_request.return_value = HTTPResponse(None, status=200) # type: ignore[arg-type]
result = processor.get_anomaly_data_from_seer(10)
assert mock_logger.exception.called_with("Failed to parse Seer anomaly detection response")
mock_logger.exception.assert_called_with(
"Failed to parse Seer anomaly detection response", extra=mock.ANY
)
assert result is None

def test_alert(self):
Expand Down

0 comments on commit c233112

Please sign in to comment.