def _test_really_huge_input(): cat = bincmd('cat') sum = 0 BUFSIZE = 10000 TIMES = 10000 with open('/dev/zero', 'rb') as fd: for x in cat(islice(iter(lambda: fd.read(BUFSIZE), ''), TIMES)): sum += len(x) eq_(sum, BUFSIZE * TIMES)
def test_nonexistent_command(): with open('/dev/null', 'wb') as null: ok_(call(bincmd('echo foo | bar --baz', stderr=null)) != 0)