MCPcopy
hub / github.com/benoitc/gunicorn / test_https_scheme

Method test_https_scheme

tests/test_uwsgi.py:152–164  ·  view source on GitHub ↗

Test scheme detection from HTTPS variable.

(self)

Source from the content-addressed store, hash-verified

150 assert headers_dict['CONTENT-LENGTH'] == '0'
151
152 def test_https_scheme(self):
153 """Test scheme detection from HTTPS variable."""
154 packet = make_uwsgi_packet({
155 'REQUEST_METHOD': 'GET',
156 'PATH_INFO': '/',
157 'HTTPS': 'on',
158 })
159 unreader = IterUnreader([packet])
160 cfg = MockConfig()
161
162 req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345))
163
164 assert req.scheme == 'https'
165
166 def test_wsgi_url_scheme(self):
167 """Test scheme from wsgi.url_scheme variable."""

Callers

nothing calls this directly

Calls 4

IterUnreaderClass · 0.90
UWSGIRequestClass · 0.90
make_uwsgi_packetFunction · 0.85
MockConfigClass · 0.70

Tested by

no test coverage detected