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

Method test_truncate_on_read_only

Lib/test/test_io.py:1774–1779  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1772 self.assertRaises(ValueError, b.seek, 0)
1773
1774 def test_truncate_on_read_only(self):
1775 rawio = self.MockFileIO(b"abc")
1776 bufio = self.tp(rawio)
1777 self.assertFalse(bufio.writable())
1778 self.assertRaises(self.UnsupportedOperation, bufio.truncate)
1779 self.assertRaises(self.UnsupportedOperation, bufio.truncate, 0)
1780
1781 def test_tell_character_device_file(self):
1782 # GH-95782

Callers

nothing calls this directly

Calls 3

assertFalseMethod · 0.80
writableMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected