def test_read_text(self): """BytesIteratorIO converts text as bytes.""" file_obj = BytesIteratorIO(generate_hello_text()) self.assertEqual(file_obj.read(), HELLO_BYTES)
def test_read_bytes(self): """BytesIteratorIO obviously accepts bytes generator.""" file_obj = BytesIteratorIO(generate_hello_bytes()) self.assertEqual(file_obj.read(), HELLO_BYTES)