def test_encoding(self):
    text = self.TEXT.decode('ascii')
    text_native_eol = text.replace('\n', os.linesep)
    with self.open(self.filename, 'wt', encoding='utf-16-le') as f:
        f.write(text)
    with open(self.filename, 'rb') as f:
        file_data = ext_decompress(f.read()).decode('utf-16-le')
        self.assertEqual(file_data, text_native_eol)
    with self.open(self.filename, 'rt', encoding='utf-16-le') as f:
        self.assertEqual(f.read(), text)
def test_encoding(self):
    text = self.TEXT.decode('ascii')
    text_native_eol = text.replace('\n', os.linesep)
    with self.open(self.filename, 'wt', encoding='utf-16-le') as f:
        f.write(text)
    with open(self.filename, 'rb') as f:
        file_data = ext_decompress(f.read()).decode('utf-16-le')
        self.assertEqual(file_data, text_native_eol)
    with self.open(self.filename, 'rt', encoding='utf-16-le') as f:
        self.assertEqual(f.read(), text)