How to use the webob.request.Request.blank function in WebOb

To help you get started, we’ve selected a few WebOb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Pylons / webob / tests / test_descriptors.py View on Github external
def test_upath_property_fset():
    from webob.descriptors import upath_property

    req = Request.blank("/")
    desc = upath_property("akey")
    desc.fset(req, "avalue")
    assert desc.fget(req) == "avalue"
github Pylons / webob / tests / test_request.py View on Github external
def _blankOne(self, *arg, **kw):
        from webob.request import Request
        return Request.blank(*arg, **kw)
github Pylons / webob / tests / test_acceptparse.py View on Github external
def test_accept_property_fget_nil():
    desc = accept_property('Accept-Charset', '14.2')
    req = Request.blank('/')
    assert type(desc.fget(req)) == NilAccept
github Pylons / webob / tests / test_descriptors.py View on Github external
def test_environ_getter_default_fset_none():
    from webob.descriptors import environ_getter

    req = Request.blank("/")
    desc = environ_getter("akey", default="the_default")
    desc.fset(req, "baz")
    desc.fset(req, None)
    assert "akey" not in req.environ
github Pylons / webob / tests / test_acceptparse.py View on Github external
def test_fdel_header_key_in_environ(self):
        request = Request.blank('/', environ={'HTTP_ACCEPT_LANGUAGE': 'es'})
        property_ = accept_language_property()
        property_.fdel(request=request)
        assert isinstance(request.accept_language, AcceptLanguageNoHeader)
        assert 'HTTP_ACCEPT_LANGUAGE' not in request.environ
github Pylons / webob / tests / test_request_nose.py View on Github external
def test_limited_length_file_repr():
    req = Request.blank('/', POST='x')
    req.body_file_raw = 'dummy'
    req.is_body_seekable = False
    eq(repr(req.body_file.raw), "")
github Pylons / webob / tests / test_acceptparse.py View on Github external
def test_accept_property_fget():
    desc = accept_property('Accept-Charset', '14.2')
    req = Request.blank('/', environ={'envkey': 'envval'})
    desc.fset(req, 'val')
    assert desc.fget(req).header_value == 'val'
github Pylons / webob / tests / test_descriptors.py View on Github external
def test_converter_delete():
    from webob.descriptors import converter
    from webob.descriptors import environ_getter
    from webob.descriptors import parse_int_safe
    from webob.descriptors import serialize_int

    req = Request.blank("/")
    desc = converter(
        environ_getter("CONTENT_LENGTH", "666", "14.13"),
        parse_int_safe,
        serialize_int,
        "int",
    )
    with pytest.raises(KeyError):
        desc.fdel(req)
github pydap / pydap / src / pydap / simple_server.py View on Github external
def disconnect(self):
        # Shutdown the server:
        (Request
         .blank("http://0.0.0.0:%s/shutdown" % self.port)
         .get_response())
        self.server_process.join()