Skip to content

Commit

Permalink
fix: mocked test4.com host
Browse files Browse the repository at this point in the history
Test was failing locally because test4.com is a real URL that responded
with a 200 when we posted events to it.

Not sure why it was succeeding in CI?
  • Loading branch information
pomegranited committed Aug 7, 2023
1 parent 5452d0f commit 31d24d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion event_routing_backends/backends/tests/test_events_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,14 @@ def test_duplicate_xapi_event_id(self, mocked_logger):
mocked_logger.info.mock_calls
)

def test_unsuccessful_routing_of_event_http(self):
@patch('event_routing_backends.utils.http_client.requests.post')
def test_unsuccessful_routing_of_event_http(self, mocked_post):
mock_response = MagicMock()
mock_response.status_code = 500
mock_response.request.method = "POST"
mock_response.text = "Fake Server Error"
mocked_post.return_value = mock_response

host_configurations = {
'url': 'http://test4.com',
'auth_scheme': 'bearer',
Expand Down

0 comments on commit 31d24d6

Please sign in to comment.