()
| 606 | |
| 607 | |
| 608 | def 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 | |
| 620 | def test_range_request_out_of_bound(): |
nothing calls this directly
no test coverage detected