def test_gzfile_input(self): ''' Test gzip file input ''' fileIn = iohandle.handlein(self.testInGZ) self.assertEqual( [fileIn.next(),fileIn.next(),fileIn.next()], [self.data1, self.data2, map(str, self.data3)] ) with self.assertRaises(EOFError): fileIn.next()
def test_list_input(self): ''' Test list input ''' listIn = iohandle.handlein(self.datalist) self.assertEqual( [listIn.next(),listIn.next(),listIn.next()], [self.data1,self.data2,self.data3] ) with self.assertRaises(EOFError): listIn.next()
def test_pipe_input(self): ''' Test pipe input ''' pipeRecv, pipeSend = multiprocessing.Pipe(False) pipeSend.send(self.data1) pipeSend.send(self.data2) pipeSend.send(self.data3) pipeSend.send(None) pipeIn = iohandle.handlein(pipeRecv) self.assertEqual( [pipeIn.next(),pipeIn.next(),pipeIn.next()], self.datalist ) with self.assertRaises(EOFError): pipeIn.next()