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

Method testInvalidModeStrings

Lib/test/test_fileio.py:556–565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

554 os.unlink(TESTFN)
555
556 def testInvalidModeStrings(self):
557 # check invalid mode strings
558 for mode in ("", "aU", "wU+", "rw", "rt"):
559 try:
560 f = self.FileIO(TESTFN, mode)
561 except ValueError:
562 pass
563 else:
564 f.close()
565 self.fail('%r is an invalid file mode' % mode)
566
567 def testModeStrings(self):
568 # test that the mode attribute is correct for various mode strings

Callers

nothing calls this directly

Calls 2

closeMethod · 0.95
failMethod · 0.45

Tested by

no test coverage detected