MCPcopy
hub / github.com/scrapy/scrapy / test_gunzip_basic

Function test_gunzip_basic

tests/test_utils_gz.py:14–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def test_gunzip_basic():
15 r1 = Response(
16 "http://www.example.com",
17 body=(SAMPLEDIR / "feed-sample1.xml.gz").read_bytes(),
18 )
19 assert gzip_magic_number(r1)
20
21 r2 = Response("http://www.example.com", body=gunzip(r1.body))
22 assert not gzip_magic_number(r2)
23 assert len(r2.body) == 9950
24
25
26def test_gunzip_truncated():

Callers

nothing calls this directly

Calls 3

ResponseClass · 0.90
gzip_magic_numberFunction · 0.90
gunzipFunction · 0.90

Tested by

no test coverage detected