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

Method test_push_random

Lib/test/test_email/test_email.py:3910–3926  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3908
3909 @unittest.expectedFailure # TODO: RUSTPYTHON
3910 def test_push_random(self):
3911 from email.feedparser import BufferedSubFile, NeedMoreData
3912
3913 n = 10000
3914 chunksize = 5
3915 chars = 'abcd \t\r\n'
3916
3917 s = ''.join(choice(chars) for i in range(n)) + '\n'
3918 target = s.splitlines(True)
3919
3920 bsf = BufferedSubFile()
3921 lines = []
3922 for i in range(0, len(s), chunksize):
3923 chunk = s[i:i+chunksize]
3924 bsf.push(chunk)
3925 lines.extend(iter(bsf.readline, NeedMoreData))
3926 self.assertEqual(lines, target)
3927
3928
3929class TestFeedParsers(TestEmailBase):

Callers

nothing calls this directly

Calls 8

pushMethod · 0.95
BufferedSubFileClass · 0.90
lenFunction · 0.85
iterFunction · 0.85
joinMethod · 0.45
splitlinesMethod · 0.45
extendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected