MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_fileobj

Method test_fileobj

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

Source from the content-addressed store, hash-verified

1148 pass
1149
1150 def test_fileobj(self):
1151 with self.open(BytesIO(self.DATA), "r") as f:
1152 self.assertEqual(f.read(), self.TEXT)
1153 with self.open(BytesIO(self.DATA), "rb") as f:
1154 self.assertEqual(f.read(), self.TEXT)
1155 text = self.TEXT.decode("ascii")
1156 with self.open(BytesIO(self.DATA), "rt", encoding="utf-8") as f:
1157 self.assertEqual(f.read(), text)
1158
1159 def test_bad_params(self):
1160 # 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