MCPcopy
hub / github.com/pallets/werkzeug / test_disabled_auto_content_length

Function test_disabled_auto_content_length

tests/test_wrappers.py:1146–1160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1144
1145
1146def test_disabled_auto_content_length():
1147 class MyResponse(wrappers.Response):
1148 automatically_set_content_length = False
1149
1150 resp = MyResponse("Hello World!")
1151 assert resp.content_length is None
1152
1153 resp = MyResponse(["Hello World!"])
1154 assert resp.content_length is None
1155 assert "Content-Length" not in resp.get_wsgi_headers({})
1156
1157 resp = MyResponse()
1158 resp.make_conditional({"REQUEST_METHOD": "GET"})
1159 assert resp.content_length is None
1160 assert "Content-Length" not in resp.get_wsgi_headers({})
1161
1162
1163@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

get_wsgi_headersMethod · 0.80
make_conditionalMethod · 0.80
MyResponseClass · 0.70

Tested by

no test coverage detected