FeedParser BufferedSubFile.push() assumed it received complete line endings. A CR ending one push() followed by a LF starting the next push() added an empty line.
(self)
| 3877 | |
| 3878 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 3879 | def test_pushCR_LF(self): |
| 3880 | '''FeedParser BufferedSubFile.push() assumed it received complete |
| 3881 | line endings. A CR ending one push() followed by a LF starting |
| 3882 | the next push() added an empty line. |
| 3883 | ''' |
| 3884 | imt = [ |
| 3885 | ("a\r \n", 2), |
| 3886 | ("b", 0), |
| 3887 | ("c\n", 1), |
| 3888 | ("", 0), |
| 3889 | ("d\r\n", 1), |
| 3890 | ("e\r", 0), |
| 3891 | ("\nf", 1), |
| 3892 | ("\r\n", 1), |
| 3893 | ] |
| 3894 | from email.feedparser import BufferedSubFile, NeedMoreData |
| 3895 | bsf = BufferedSubFile() |
| 3896 | om = [] |
| 3897 | nt = 0 |
| 3898 | for il, n in imt: |
| 3899 | bsf.push(il) |
| 3900 | nt += n |
| 3901 | n1 = 0 |
| 3902 | for ol in iter(bsf.readline, NeedMoreData): |
| 3903 | om.append(ol) |
| 3904 | n1 += 1 |
| 3905 | self.assertEqual(n, n1) |
| 3906 | self.assertEqual(len(om), nt) |
| 3907 | self.assertEqual(''.join([il for il, n in imt]), ''.join(om)) |
| 3908 | |
| 3909 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 3910 | def test_push_random(self): |
nothing calls this directly
no test coverage detected