示例#1
0
def test_popen_io_readloop(monkeypatch, execmodel):
    sio = BytesIO('test'.encode('ascii'))
    io = Popen2IO(sio, sio, execmodel)
    real_read = io._read

    def newread(numbytes):
        if numbytes > 1:
            numbytes = numbytes-1
        return real_read(numbytes)
    io._read = newread
    result = io.read(3)
    assert result == 'tes'.encode('ascii')
示例#2
0
 def __init__(self, args, execmodel):
     self.popen = p = execmodel.PopenPiped(args)
     Popen2IO.__init__(self, p.stdin, p.stdout, execmodel=execmodel)
示例#3
0
 def __init__(self, args, execmodel):
     self.popen = p = execmodel.PopenPiped(args)
     Popen2IO.__init__(self, p.stdin, p.stdout, execmodel=execmodel)
 def __init__(self, args):
     self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE)
     Popen2IO.__init__(self, p.stdin, p.stdout)
示例#5
0
 def __init__(self, args):
     self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE)
     Popen2IO.__init__(self, p.stdin, p.stdout)