Esempio n. 1
0
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']
Esempio n. 2
0
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']
Esempio n. 3
0
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']
Esempio n. 4
0
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']
Esempio n. 5
0
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')
Esempio n. 6
0
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')