Ejemplo n.º 1
0
 def setUp(self):
     #            0         1         2         3         4         5          6         7         8         9
     #            0123456789012345678901234567890123456789012345678901234567 890123456789012345678901234567890
     self.test = 'Why cannot we write the entire 24 volumes of Encyclopaedia\nBrittanica on the head of a pin?\n'
     self.fo = StringIO(unicode(self.test) if not six.PY3 else self.test)
     self.rfo = RangeableFileObject(self.fo, (20, 69))
Ejemplo n.º 2
0
 def test_readall(self):
     """RangeableFileObject.read(): to end of file."""
     text_compat = unicode(self.test) if not six.PY3 else self.test
     rfo = RangeableFileObject(StringIO(text_compat), (11, ))
     self.assertEquals(self.test[11:], rfo.read())
Ejemplo n.º 3
0
 def test_readall(self):
     """RangeableFileObject.read(): to end of file."""
     rfo = RangeableFileObject(StringIO(self.test), (11, ))
     self.assertEquals(self.test[11:], rfo.read())