def test_fileobj(self):
    with self.open(BytesIO(self.DATA), 'r') as f:
        self.assertEqual(f.read(), self.TEXT)
    with self.open(BytesIO(self.DATA), 'rb') as f:
        self.assertEqual(f.read(), self.TEXT)
    text = self.TEXT.decode('ascii')
    with self.open(BytesIO(self.DATA), 'rt', encoding='utf-8') as f:
        self.assertEqual(f.read(), text)
def test_fileobj(self):
    with self.open(BytesIO(self.DATA), 'r') as f:
        self.assertEqual(f.read(), self.TEXT)
    with self.open(BytesIO(self.DATA), 'rb') as f:
        self.assertEqual(f.read(), self.TEXT)
    text = self.TEXT.decode('ascii')
    with self.open(BytesIO(self.DATA), 'rt', encoding='utf-8') as f:
        self.assertEqual(f.read(), text)