Exemplo n.º 1
0
def test_pipe():
    from popysh.syscmd import cat, grep, tr

    out = cat(input="bla\nbli\nblo").pipe(grep("bl[ai]")).pipe(tr("b", "c")).as_bytes()

    eq_(out, "cla\ncli\n")
Exemplo n.º 2
0
def test_as_lines():
    from popysh.syscmd import cat

    lines = cat(input="bla\nbli").as_lines()
    eq_(lines, ["bla", "bli"])