MCPcopy
hub / github.com/scrapy/scrapy / test_gunzip_truncated_short

Function test_gunzip_truncated_short

tests/test_utils_gz.py:36–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def test_gunzip_truncated_short():
37 r1 = Response(
38 "http://www.example.com",
39 body=(SAMPLEDIR / "truncated-crc-error-short.gz").read_bytes(),
40 )
41 assert gzip_magic_number(r1)
42
43 r2 = Response("http://www.example.com", body=gunzip(r1.body))
44 assert r2.body.endswith(b"</html>")
45 assert not gzip_magic_number(r2)
46
47
48def test_is_gzipped_empty():

Callers

nothing calls this directly

Calls 3

ResponseClass · 0.90
gzip_magic_numberFunction · 0.90
gunzipFunction · 0.90

Tested by

no test coverage detected