def setUp(self):
        self.patcher = patch('ffmpegwrapper.ffmpeg.Popen')
        popen = self.patcher.start()
        self.instance = popen.return_value

        read_value = bytearray(b'this is a line\nthis too\n')
        poll = lambda: None if read_value else 0

        def read(*args):
            try:
                return bytearray([read_value.pop(0)])
            except __HOLE__:
                return b''

        self.instance.poll.side_effect = poll
        self.instance.stdout.read.side_effect = read
dataset/ETHPy150Open interru/ffmpegwrapper/test.py/FFmpegTestCase.setUp