def test_pipe(self): with uio.open(dataFolder / 'lines.txt') as lines: cleanup, stop = lines.pipe(self.f) stop.wait() cleanup() self.assertEqual(self.read(), 'first line\nsecond line\nthird line\nend\n')
def setUp(self): fd, self.path = tempfile.mkstemp(prefix='uiotest-') os.close(fd) self.f = uio.open(self.path, 'r+')
def setUp(self): self.f = uio.open(dataFolder / 'lines.txt', 'rb')
def test_pipe_block(self): with uio.open(dataFolder / 'lines.txt') as lines: lines = uio.open(dataFolder / 'lines.txt') lines.pipe(self.f, block=True) self.assertEqual(self.read(), 'first line\nsecond line\nthird line\nend\n')
def setUp(self): self.f = uio.open(dataFolder / 'broken-uni.txt')