Пример #1
0
 def test_can_specify_amount_for_nonseekable_stream(self):
     nonseekable_fileobj = NonSeekableStream(StringIO('foobar'))
     self.assertEqual(nonseekable_fileobj.read(3), 'foo')
Пример #2
0
 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')
Пример #3
0
 def _get_filein(self, fileinfo):
     binary_stdin = get_binary_stdin()
     return NonSeekableStream(binary_stdin)