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

Function test_client_open_environ

tests/test_testing.py:73–87  ·  view source on GitHub ↗
(app, client, request)

Source from the content-addressed store, hash-verified

71
72
73def test_client_open_environ(app, client, request):
74 @app.route("/index")
75 def index():
76 return flask.request.remote_addr
77
78 builder = EnvironBuilder(app, path="/index", method="GET")
79 request.addfinalizer(builder.close)
80
81 rv = client.open(builder)
82 assert rv.data == b"127.0.0.1"
83
84 environ = builder.get_environ()
85 client.environ_base["REMOTE_ADDR"] = "127.0.0.2"
86 rv = client.open(environ)
87 assert rv.data == b"127.0.0.2"
88
89
90def test_specify_url_scheme(app, client):

Callers

nothing calls this directly

Calls 2

EnvironBuilderClass · 0.90
openMethod · 0.80

Tested by

no test coverage detected