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

Method test_open_common

Lib/test/test_pathlib/test_pathlib.py:1310–1317  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1308 self.assertEqual(42, dirpath.session_id)
1309
1310 def test_open_common(self):
1311 p = self.cls(self.base)
1312 with (p / 'fileA').open('r') as f:
1313 self.assertIsInstance(f, io.TextIOBase)
1314 self.assertEqual(f.read(), "this is file A\n")
1315 with (p / 'fileA').open('rb') as f:
1316 self.assertIsInstance(f, io.BufferedIOBase)
1317 self.assertEqual(f.read().strip(), b"this is file A")
1318
1319 def test_open_unbuffered(self):
1320 p = self.cls(self.base)

Callers

nothing calls this directly

Calls 6

assertIsInstanceMethod · 0.80
clsMethod · 0.45
openMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected