Verify that wrapped is not None
If wrapped is None we raise a ValueError to let the user know that we
are unable to continue.
| | |
| | | from pyramid.wsgi import wsgiapp |
| | | return wsgiapp(app) |
| | | |
| | | def test_wsgiapp_none(self): |
| | | self.assertRaises(ValueError, self._callFUT, None) |
| | | |
| | | def test_wsgiapp_none_func(self): |
| | | from pyramid.wsgi import wsgiapp |
| | | |
| | | def some_func(): |
| | | pass |
| | | |
| | | self.assertRaises(ValueError, wsgiapp, some_func()) |
| | | |
| | | def test_decorator(self): |
| | | context = DummyContext() |
| | | request = DummyRequest() |
| | |
| | | from pyramid.wsgi import wsgiapp2 |
| | | return wsgiapp2(app) |
| | | |
| | | def test_wsgiapp2_none(self): |
| | | self.assertRaises(ValueError, self._callFUT, None) |
| | | |
| | | def test_wsgiapp2_none_func(self): |
| | | from pyramid.wsgi import wsgiapp2 |
| | | |
| | | def some_func(): |
| | | pass |
| | | |
| | | self.assertRaises(ValueError, wsgiapp2, some_func()) |
| | | |
| | | def test_decorator_with_subpath_and_view_name(self): |
| | | context = DummyContext() |
| | | request = DummyRequest() |
| | |
| | | view. |
| | | |
| | | """ |
| | | |
| | | if wrapped is None: |
| | | raise ValueError('wrapped can not be None') |
| | | |
| | | def decorator(context, request): |
| | | return request.get_response(wrapped) |
| | | |
| | |
| | | subpath is used as the ``SCRIPT_NAME``. The new environment is passed to |
| | | the downstream WSGI application.""" |
| | | |
| | | if wrapped is None: |
| | | raise ValueError('wrapped can not be None') |
| | | |
| | | def decorator(context, request): |
| | | return call_app_with_subpath_as_path_info(request, wrapped) |
| | | |