Example #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']
Example #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']
Example #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']
Example #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']
Example #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')
Example #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')