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

Function test_range_request_basic

tests/test_wrappers.py:608–617  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

606
607
608def test_range_request_basic():
609 env = create_environ()
610 response = wrappers.Response("Hello World")
611 env["HTTP_RANGE"] = "bytes=0-4"
612 response.make_conditional(env, accept_ranges=True, complete_length=11)
613 assert response.status_code == 206
614 assert response.headers["Accept-Ranges"] == "bytes"
615 assert response.headers["Content-Range"] == "bytes 0-4/11"
616 assert response.headers["Content-Length"] == "5"
617 assert response.data == b"Hello"
618
619
620def test_range_request_out_of_bound():

Callers

nothing calls this directly

Calls 2

make_conditionalMethod · 0.95
create_environFunction · 0.90

Tested by

no test coverage detected