MCPcopy
hub / github.com/pallets/flask / test_bad_environ_raises_bad_request

Function test_bad_environ_raises_bad_request

tests/test_reqctx.py:280–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

278
279
280def test_bad_environ_raises_bad_request():
281 app = flask.Flask(__name__)
282
283 from flask.testing import EnvironBuilder
284
285 builder = EnvironBuilder(app)
286 environ = builder.get_environ()
287
288 # use a non-printable character in the Host - this is key to this test
289 environ["HTTP_HOST"] = "\x8a"
290
291 with app.request_context(environ):
292 response = app.full_dispatch_request()
293 assert response.status_code == 400
294
295
296def test_environ_for_valid_idna_completes():

Callers

nothing calls this directly

Calls 3

request_contextMethod · 0.95
full_dispatch_requestMethod · 0.95
EnvironBuilderClass · 0.90

Tested by

no test coverage detected