def test_no_request_factory_error(self, mock_validate): spec = mock.sentinel.spec request = mock.sentinel.request mock_validate.return_value = ResultMock(error_to_raise=ValueError) with pytest.raises(ValueError): spec_validate_body(spec, request) mock_validate.aasert_called_once_with(request)
def test_no_request_factory(self, mock_validate): spec = mock.sentinel.spec request = mock.sentinel.request body = mock.sentinel.body mock_validate.return_value = ResultMock(body=body) result = spec_validate_body(spec, request) assert result == body mock_validate.aasert_called_once_with(request)