Skip to content

Commit

Permalink
test: update test with from_event_bus
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Feb 9, 2024
1 parent 2aaa946 commit b18b09f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openedx_events/tests/test_tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def test_send_event_allow_failure_successfully(self, send_mock, fake_metadata):
sender=None,
user=self.user_mock,
metadata=expected_metadata,
from_event_bus=False,
)

@patch("openedx_events.tooling.OpenEdxPublicSignal.generate_signal_metadata")
Expand All @@ -198,7 +199,8 @@ def test_send_robust_event_successfully(self, format_responses_mock, log_mock, f
self.public_signal.send_event(user=self.user_mock)

self.ok_receiver.assert_called_once_with(
signal=self.public_signal, sender=None, user=self.user_mock, metadata=expected_metadata
signal=self.public_signal, sender=None, user=self.user_mock, metadata=expected_metadata,
from_event_bus=False
)
# format_responses is mocked out because its output is
# complicated enough to warrant its own set of tests.
Expand Down Expand Up @@ -253,7 +255,7 @@ def test_send_event_with_custom_metadata(self, mock_send_event_with_metadata):

assert response == expected_response
mock_send_event_with_metadata.assert_called_once_with(
metadata=metadata, send_robust=True, foo="bar",
metadata=metadata, send_robust=True, foo="bar", from_event_bus=True
)

@ddt.data(
Expand Down

0 comments on commit b18b09f

Please sign in to comment.