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

Method test_open_rb

Lib/test/test_pathlib/test_read.py:56–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54 self.assertEqual(wc.filename, __file__)
55
56 def test_open_rb(self):
57 p = self.root / 'fileA'
58 with vfsopen(p, 'rb') as f:
59 self.assertEqual(f.read(), b'this is file A\n')
60 self.assertRaises(ValueError, vfsopen, p, 'rb', encoding='utf8')
61 self.assertRaises(ValueError, vfsopen, p, 'rb', errors='strict')
62 self.assertRaises(ValueError, vfsopen, p, 'rb', newline='')
63
64 def test_read_bytes(self):
65 p = self.root / 'fileA'

Callers

nothing calls this directly

Calls 4

vfsopenFunction · 0.90
assertEqualMethod · 0.45
readMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected