def test_file_size(): counts = (len(text), len(text) + text.count("\n")) with filetext(text) as fn: assert file_size(fn) in counts with filetext(text.encode(), open=gzip.open) as fn: assert file_size(fn, "gzip") in counts
def test_file_size(): counts = (len(text), len(text) + text.count('\n')) with filetext(text) as fn: assert file_size(fn) in counts with filetext(text.encode(), open=gzip.open) as fn: assert file_size(fn, 'gzip') in counts
def test_file_size(): counts = (len(text), len(text) + text.count('\n')) with filetext(text) as fn: assert file_size(fn) in counts with filetext(text.encode(), open=GzipFile) as fn: assert file_size(fn, 'gzip') in counts