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

Function test_stream_content_length

tests/test_wrappers.py:1131–1143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1129
1130
1131def test_stream_content_length():
1132 resp = wrappers.Response()
1133 resp.stream.writelines(["foo", "bar", "baz"])
1134 assert resp.get_wsgi_headers({})["Content-Length"] == "9"
1135
1136 resp = wrappers.Response()
1137 resp.make_conditional({"REQUEST_METHOD": "GET"})
1138 resp.stream.writelines(["foo", "bar", "baz"])
1139 assert resp.get_wsgi_headers({})["Content-Length"] == "9"
1140
1141 resp = wrappers.Response("foo")
1142 resp.stream.writelines(["bar", "baz"])
1143 assert resp.get_wsgi_headers({})["Content-Length"] == "9"
1144
1145
1146def test_disabled_auto_content_length():

Callers

nothing calls this directly

Calls 3

get_wsgi_headersMethod · 0.95
make_conditionalMethod · 0.95
writelinesMethod · 0.45

Tested by

no test coverage detected