diff options
Diffstat (limited to '')
| -rw-r--r-- | tests/tasks/test_receiver.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tasks/test_receiver.py b/tests/tasks/test_receiver.py index 133ab56..51d1bb6 100644 --- a/tests/tasks/test_receiver.py +++ b/tests/tasks/test_receiver.py @@ -198,6 +198,25 @@ def test_fetch_source_rejects_streamed_oversized_body( receiver.fetch_source(SOURCE_URL) +@patch("webmentions_ssg.tasks.receiver.httpx.Client") +def test_fetch_source_does_not_mask_unexpected_value_error( + httpx_client: Mock, + app: Flask, + receiver: ModuleType, + monkeypatch: pytest.MonkeyPatch, +) -> None: + set_stream_response( + httpx_client, + httpx.Response(200, request=httpx.Request("GET", SOURCE_URL)), + ) + monkeypatch.setattr( + receiver, "read_limited_body", Mock(side_effect=ValueError("unexpected bug")) + ) + + with app.app_context(), pytest.raises(ValueError, match="unexpected bug"): + receiver.fetch_source(SOURCE_URL) + + @patch("webmentions_ssg.tasks.receiver.fetch_source") @pytest.mark.parametrize( ("content_type", "body", "expected"), |
