def test_can_specify_amount_for_nonseekable_stream(self): nonseekable_fileobj = NonSeekableStream(StringIO('foobar')) self.assertEqual(nonseekable_fileobj.read(3), 'foo')
def test_can_make_stream_unseekable(self): fileobj = StringIO('foobar') self.assertTrue(seekable(fileobj)) nonseekable_fileobj = NonSeekableStream(fileobj) self.assertFalse(seekable(nonseekable_fileobj)) self.assertEqual(nonseekable_fileobj.read(), 'foobar')
def _get_filein(self, fileinfo): binary_stdin = get_binary_stdin() return NonSeekableStream(binary_stdin)