示例#1
0
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
示例#2
0
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
示例#3
0
文件: test_io.py 项目: acrosby/dask
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