"""Test exception.""" import pytest from product_review.util import exception @pytest.mark.parametrize( ( "test_description", "kwargs", "expected_raise_message", ), [ ( "default values", {}, '{"status": null, "code": null, "message": null}', ), ( "values specified", { "status": 123, "code": "some-code", "message": "a message", }, '{"status": 123, "code": "some-code", "message": "a message"}', ), ], ) def test_raise_exception_for_ows_response( test_description, kwargs, expected_raise_message ): """Test raise_exception_for_ows_response.""" with pytest.raises(Exception) as e: exception.raise_exception_for_ows_response(**kwargs) assert str(getattr(e, "value", None)) == expected_raise_message