(self)
| 712 | "spamspam", self.spambe) |
| 713 | |
| 714 | def test_bug691291(self): |
| 715 | # If encoding is not None, then |
| 716 | # files are always opened in binary mode, even if no binary mode was |
| 717 | # specified. This means that no automatic conversion of '\n' is done |
| 718 | # on reading and writing. |
| 719 | s1 = 'Hello\r\nworld\r\n' |
| 720 | |
| 721 | s = s1.encode(self.encoding) |
| 722 | self.addCleanup(os_helper.unlink, os_helper.TESTFN) |
| 723 | with open(os_helper.TESTFN, 'wb') as fp: |
| 724 | fp.write(s) |
| 725 | with codecs_open_no_warn(os_helper.TESTFN, 'r', |
| 726 | encoding=self.encoding) as reader: |
| 727 | self.assertEqual(reader.read(), s1) |
| 728 | |
| 729 | def test_invalid_modes(self): |
| 730 | for mode in ('U', 'rU', 'r+U'): |
nothing calls this directly
no test coverage detected