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

Method test_incomplete_header

tests/test_uwsgi.py:215–222  ·  view source on GitHub ↗

Test error on incomplete header.

(self)

Source from the content-addressed store, hash-verified

213 """Test UWSGIRequest error handling."""
214
215 def test_incomplete_header(self):
216 """Test error on incomplete header."""
217 unreader = IterUnreader([b'\x00\x00']) # Only 2 bytes
218 cfg = MockConfig()
219
220 with pytest.raises(InvalidUWSGIHeader) as exc_info:
221 UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345))
222 assert 'incomplete header' in str(exc_info.value)
223
224 def test_incomplete_vars_block(self):
225 """Test error on truncated vars block."""

Callers

nothing calls this directly

Calls 3

IterUnreaderClass · 0.90
UWSGIRequestClass · 0.90
MockConfigClass · 0.70

Tested by

no test coverage detected