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")
def test_as_lines(): from popysh.syscmd import cat lines = cat(input="bla\nbli").as_lines() eq_(lines, ["bla", "bli"])