mirror of https://github.com/scrapy/scrapy.git
PY3: port scrapy/utils/gz.py
This commit is contained in:
parent
910d0d36c1
commit
c564334d00
|
|
@ -64,7 +64,6 @@ tests/test_squeue.py
|
|||
tests/test_stats.py
|
||||
tests/test_toplevel.py
|
||||
tests/test_utils_defer.py
|
||||
tests/test_utils_gz.py
|
||||
tests/test_utils_httpobj.py
|
||||
tests/test_utils_iterators.py
|
||||
tests/test_utils_jsonrpc.py
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import unittest
|
||||
from os.path import join
|
||||
|
||||
from tests import tests_datadir
|
||||
from scrapy.utils.gz import gunzip
|
||||
from tests import tests_datadir
|
||||
|
||||
SAMPLEDIR = join(tests_datadir, 'compressed')
|
||||
|
||||
|
||||
class GzTest(unittest.TestCase):
|
||||
|
||||
def test_gunzip_basic(self):
|
||||
|
|
@ -16,7 +17,7 @@ class GzTest(unittest.TestCase):
|
|||
def test_gunzip_truncated(self):
|
||||
with open(join(SAMPLEDIR, 'truncated-crc-error.gz'), 'rb') as f:
|
||||
text = gunzip(f.read())
|
||||
assert text.endswith('</html')
|
||||
assert text.endswith(b'</html')
|
||||
|
||||
def test_gunzip_no_gzip_file_raises(self):
|
||||
with open(join(SAMPLEDIR, 'feed-sample1.xml'), 'rb') as f:
|
||||
|
|
@ -25,4 +26,4 @@ class GzTest(unittest.TestCase):
|
|||
def test_gunzip_truncated_short(self):
|
||||
with open(join(SAMPLEDIR, 'truncated-crc-error-short.gz'), 'rb') as f:
|
||||
text = gunzip(f.read())
|
||||
assert text.endswith('</html>')
|
||||
assert text.endswith(b'</html>')
|
||||
|
|
|
|||
Loading…
Reference in New Issue