Test that HTTP_* vars become headers.
(self)
| 114 | assert req.body.read() == body |
| 115 | |
| 116 | def test_parse_headers(self): |
| 117 | """Test that HTTP_* vars become headers.""" |
| 118 | packet = make_uwsgi_packet({ |
| 119 | 'REQUEST_METHOD': 'GET', |
| 120 | 'PATH_INFO': '/', |
| 121 | 'HTTP_HOST': 'example.com', |
| 122 | 'HTTP_USER_AGENT': 'TestClient/1.0', |
| 123 | 'HTTP_ACCEPT': 'text/html', |
| 124 | }) |
| 125 | unreader = IterUnreader([packet]) |
| 126 | cfg = MockConfig() |
| 127 | |
| 128 | req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) |
| 129 | |
| 130 | headers_dict = dict(req.headers) |
| 131 | assert headers_dict['HOST'] == 'example.com' |
| 132 | assert headers_dict['USER-AGENT'] == 'TestClient/1.0' |
| 133 | assert headers_dict['ACCEPT'] == 'text/html' |
| 134 | |
| 135 | def test_parse_content_type_header(self): |
| 136 | """Test that CONTENT_TYPE becomes a header.""" |
nothing calls this directly
no test coverage detected