MCPcopy Index your code
hub / github.com/python/cpython / test_fileobj

Method test_fileobj

Lib/test/test_bz2.py:1159–1166  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1157 pass
1158
1159 def test_fileobj(self):
1160 with self.open(BytesIO(self.DATA), "r") as f:
1161 self.assertEqual(f.read(), self.TEXT)
1162 with self.open(BytesIO(self.DATA), "rb") as f:
1163 self.assertEqual(f.read(), self.TEXT)
1164 text = self.TEXT.decode("ascii")
1165 with self.open(BytesIO(self.DATA), "rt", encoding="utf-8") as f:
1166 self.assertEqual(f.read(), text)
1167
1168 def test_bad_params(self):
1169 # Test invalid parameter combinations.

Callers

nothing calls this directly

Calls 5

openMethod · 0.95
BytesIOClass · 0.90
assertEqualMethod · 0.45
readMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected