Пример #1
0
def test_chunks_textfile():
    with filetexts({'a1.log': 'Hello\nWorld', 'a2.log': 'Hola\nMundo'}) as fns:
        logs = chunks(TextFile)(list(map(TextFile, fns)))
        assert set(map(str.strip, convert(list, logs))) == \
                set(['Hello', 'World', 'Hola', 'Mundo'])
Пример #2
0
def test_temp():
    t = convert(Temp(TextFile), [1, 2, 3])
    assert [int(line.strip()) for line in convert(list, t)] == [1, 2, 3]
Пример #3
0
def test_convert():
    with filetext('Hello\nWorld') as fn:
        assert convert(list, TextFile(fn)) == ['Hello\n', 'World']