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

Method test_invalid_modes

Lib/test/test_codecs.py:728–738  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

726 self.assertEqual(reader.read(), s1)
727
728 def test_invalid_modes(self):
729 for mode in ('U', 'rU', 'r+U'):
730 with self.assertRaises(ValueError) as cm:
731 codecs_open_no_warn(os_helper.TESTFN, mode, encoding=self.encoding)
732 self.assertIn('invalid mode', str(cm.exception))
733
734 for mode in ('rt', 'wt', 'at', 'r+t'):
735 with self.assertRaises(ValueError) as cm:
736 codecs_open_no_warn(os_helper.TESTFN, mode, encoding=self.encoding)
737 self.assertIn("can't have text and binary mode at once",
738 str(cm.exception))
739
740
741class UTF16LETest(ReadTest, unittest.TestCase):

Callers

nothing calls this directly

Calls 4

codecs_open_no_warnFunction · 0.85
strFunction · 0.85
assertInMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected