()
| 376 | |
| 377 | |
| 378 | def test_create_environ(): |
| 379 | env = create_environ("/foo?bar=baz", "http://example.org/") |
| 380 | expected = { |
| 381 | "wsgi.multiprocess": False, |
| 382 | "wsgi.version": (1, 0), |
| 383 | "wsgi.run_once": False, |
| 384 | "wsgi.errors": sys.stderr, |
| 385 | "wsgi.multithread": False, |
| 386 | "wsgi.url_scheme": "http", |
| 387 | "SCRIPT_NAME": "", |
| 388 | "SERVER_NAME": "example.org", |
| 389 | "REQUEST_METHOD": "GET", |
| 390 | "HTTP_HOST": "example.org", |
| 391 | "PATH_INFO": "/foo", |
| 392 | "SERVER_PORT": "80", |
| 393 | "SERVER_PROTOCOL": "HTTP/1.1", |
| 394 | "QUERY_STRING": "bar=baz", |
| 395 | } |
| 396 | for key, value in iter(expected.items()): |
| 397 | assert env[key] == value |
| 398 | assert env["wsgi.input"].read(0) == b"" |
| 399 | assert create_environ("/foo", "http://example.com/")["SCRIPT_NAME"] == "" |
| 400 | |
| 401 | |
| 402 | def test_create_environ_query_string_error(): |
nothing calls this directly
no test coverage detected