MCPcopy Create free account
hub / github.com/pallets/flask / test_environ_base_modified

Function test_environ_base_modified

tests/test_testing.py:57–70  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

55
56
57def test_environ_base_modified(app, client):
58 @app.route("/")
59 def index():
60 flask.g.remote_addr = flask.request.remote_addr
61 flask.g.user_agent = flask.request.user_agent.string
62 return ""
63
64 client.environ_base["REMOTE_ADDR"] = "192.168.0.22"
65 client.environ_base["HTTP_USER_AGENT"] = "Foo"
66
67 with client:
68 client.get("/")
69 assert flask.g.remote_addr == "192.168.0.22"
70 assert flask.g.user_agent == "Foo"
71
72
73def test_client_open_environ(app, client, request):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected