MCPcopy
hub / github.com/encode/starlette / test_build_environ_encoding

Function test_build_environ_encoding

tests/middleware/test_wsgi.py:152–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150
151
152def test_build_environ_encoding() -> None:
153 scope = {
154 "type": "http",
155 "http_version": "1.1",
156 "method": "GET",
157 "path": "/小星",
158 "root_path": "/中国",
159 "query_string": b"a=123&b=456",
160 "headers": [],
161 }
162 environ = build_environ(scope, b"")
163 assert environ["SCRIPT_NAME"] == "/中国".encode().decode("latin-1")
164 assert environ["PATH_INFO"] == "/小星".encode().decode("latin-1")

Callers

nothing calls this directly

Calls 2

build_environFunction · 0.90
decodeMethod · 0.80

Tested by

no test coverage detected