def test_range_with_unknown_unit_is_ignored(): request = Request("GET", b"/foo", [(b"Range", b"peanuts=200-1000, 2000-6576, 19000- ")]) assert _get_requested_range(request) is None
def test_get_requested_range_raises_for_invalid_range(): request = Request("GET", b"/foo", [(b"range", b"XXXXXXXXXXXX")]) with pytest.raises(BadRequest): _get_requested_range(request)