Beispiel #1
0
 def get_file(self):
     """Return wrapper on ``StringIteratorIO`` object."""
     file_obj = TextIteratorIO(generate_hello())
     return VirtualFile(file_obj, name='hello-world.txt')
Beispiel #2
0
 def test_read_bytes(self):
     """TextIteratorIO converts bytes as text."""
     file_obj = TextIteratorIO(generate_hello_bytes())
     self.assertEqual(file_obj.read(), HELLO_TEXT)
 def test_read_bytes(self):
     """TextIteratorIO converts bytes as text."""
     file_obj = TextIteratorIO(generate_hello_bytes())
     self.assertEqual(file_obj.read(), HELLO_TEXT)
Beispiel #4
0
 def test_read_text(self):
     """TextIteratorIO obviously accepts text generator."""
     file_obj = TextIteratorIO(generate_hello_text())
     self.assertEqual(file_obj.read(), HELLO_TEXT)
 def test_read_text(self):
     """TextIteratorIO obviously accepts text generator."""
     file_obj = TextIteratorIO(generate_hello_text())
     self.assertEqual(file_obj.read(), HELLO_TEXT)