コード例 #1
0
ファイル: test_readable.py プロジェクト: eBay/wextracto
def test_readables_from_paths_file(tmpdir):
    wexin = tmpdir.join('0.wexin')
    with wexin.open('w') as fp:
        fp.write('foo')
    data = []
    for readable in readables_from_paths([wexin.strpath]):
        data.append(read_chunks(readable))
    assert data == [b'foo']
コード例 #2
0
ファイル: test_readable.py プロジェクト: ortodesign/wextracto
def test_readables_from_paths_file(tmpdir):
    wexin = tmpdir.join('0.wexin')
    with wexin.open('w') as fp:
        fp.write('foo')
    data = []
    for readable in readables_from_paths([wexin.strpath]):
        data.append(read_chunks(readable))
    assert data == [b'foo']
コード例 #3
0
ファイル: test_readable.py プロジェクト: eBay/wextracto
def test_readables_from_paths_dir(tmpdir):
    dir1 = tmpdir.mkdir('dir1')
    wexin = dir1.join('0.wexin')
    with wexin.open('w') as fp:
        fp.write('foo')
    data = []
    for readable in readables_from_paths([tmpdir.strpath]):
        data.append(read_chunks(readable))
    assert data == [b'foo']
コード例 #4
0
ファイル: test_readable.py プロジェクト: ortodesign/wextracto
def test_readables_from_paths_dir(tmpdir):
    dir1 = tmpdir.mkdir('dir1')
    wexin = dir1.join('0.wexin')
    with wexin.open('w') as fp:
        fp.write('foo')
    data = []
    for readable in readables_from_paths([tmpdir.strpath]):
        data.append(read_chunks(readable))
    assert data == [b'foo']
コード例 #5
0
ファイル: test_readable.py プロジェクト: eBay/wextracto
def test_readables_from_paths_url():
    data = []
    for readable in readables_from_paths(['http://httpbin.org/headers']):
        data.append(read_chunks(readable))
    assert data[0].startswith(b'HTTP/1.1 200 OK')
コード例 #6
0
ファイル: test_readable.py プロジェクト: ortodesign/wextracto
def test_readables_from_paths_url():
    data = []
    for readable in readables_from_paths(['http://httpbin.org/headers']):
        data.append(read_chunks(readable))
    assert data[0].startswith(b'HTTP/1.1 200 OK')