forked from kenzuya/unshackle
test(tests): make the body-retry, websocket debug-entry and gzip segment tests deterministic
This commit is contained in:
@@ -10,12 +10,16 @@ from tests.core.test_rolling_merge_hls_ism import INIT, PARTS, hls_track, make_c
|
||||
from unshackle.core.manifests import HLS
|
||||
|
||||
|
||||
def cut_gzip(part: bytes) -> bytes:
|
||||
return gzip.compress(part, mtime=0)[:-4]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"body, expected",
|
||||
[
|
||||
pytest.param(gzip.compress, lambda part: part, id="gzip"),
|
||||
pytest.param(lambda part: b"\x1f\x8b\x08" + part, lambda part: b"\x1f\x8b\x08" + part, id="gzip-magic-only"),
|
||||
pytest.param(lambda part: gzip.compress(part)[:-4], lambda part: gzip.compress(part)[:-4], id="cut-gzip"),
|
||||
pytest.param(cut_gzip, cut_gzip, id="cut-gzip"),
|
||||
],
|
||||
)
|
||||
def test_only_a_whole_gzip_segment_is_inflated(body, expected, server, tmp_path): # noqa: F811
|
||||
|
||||
Reference in New Issue
Block a user