Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Jan 31, 2024
1 parent b6bfb81 commit 4c38557
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from sentry import eventstore
from sentry.event_manager import EventManager
from sentry.features import has
from sentry.ingest.consumer.processors import (
process_attachment_chunk,
process_event,
Expand Down Expand Up @@ -260,7 +261,10 @@ def test_feedbacks_spawn_save_event_feedback(
@django_db_all
@pytest.mark.parametrize("missing_chunks", (True, False))
def test_with_attachments(default_project, task_runner, missing_chunks, monkeypatch, django_cache):
monkeypatch.setattr("sentry.features.has", lambda *a, **kw: True)
def mock_has(feature_name, *args, **kwargs):
return True if "event-attachments" in feature_name else has(feature_name, *args, **kwargs)

monkeypatch.setattr("sentry.features.has", mock_has)

payload = get_normalized_event({"message": "hello world"}, default_project)
event_id = payload["event_id"]
Expand Down Expand Up @@ -427,7 +431,14 @@ def test_deobfuscate_view_hierarchy(default_project, task_runner):
def test_individual_attachments(
default_project, factories, monkeypatch, event_attachments, chunks, with_group, django_cache
):
monkeypatch.setattr("sentry.features.has", lambda *a, **kw: event_attachments)
def mock_has(feature_name, *args, **kwargs):
return (
event_attachments
if "event-attachments" in feature_name
else has(feature_name, *args, **kwargs)
)

monkeypatch.setattr("sentry.features.has", mock_has)

event_id = uuid.uuid4().hex
attachment_id = "ca90fb45-6dd9-40a0-a18f-8693aa621abb"
Expand Down

0 comments on commit 4c38557

Please sign in to comment.