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

Function test_environ_for_valid_idna_completes

tests/test_reqctx.py:296–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294
295
296def test_environ_for_valid_idna_completes():
297 app = flask.Flask(__name__)
298
299 @app.route("/")
300 def index():
301 return "Hello World!"
302
303 from flask.testing import EnvironBuilder
304
305 builder = EnvironBuilder(app)
306 environ = builder.get_environ()
307
308 # these characters are all IDNA-compatible
309 environ["HTTP_HOST"] = "ąśźäüжŠßя.com"
310
311 with app.request_context(environ):
312 response = app.full_dispatch_request()
313
314 assert response.status_code == 200
315
316
317def test_normal_environ_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