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

Method test_open_wb

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

Source from the content-addressed store, hash-verified

54 self.assertEqual(wc.filename, __file__)
55
56 def test_open_wb(self):
57 p = self.root / 'fileA'
58 with vfsopen(p, 'wb') as f:
59 #self.assertIsInstance(f, io.BufferedWriter)
60 f.write(b'this is file A\n')
61 self.assertEqual(self.ground.readbytes(p), b'this is file A\n')
62 self.assertRaises(ValueError, vfsopen, p, 'wb', encoding='utf8')
63 self.assertRaises(ValueError, vfsopen, p, 'wb', errors='strict')
64 self.assertRaises(ValueError, vfsopen, p, 'wb', newline='')
65
66 def test_write_bytes(self):
67 p = self.root / 'fileA'

Callers

nothing calls this directly

Calls 5

vfsopenFunction · 0.90
writeMethod · 0.45
assertEqualMethod · 0.45
readbytesMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected