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

Method test_newlines

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

Source from the content-addressed store, hash-verified

3942
3943 @unittest.expectedFailure # TODO: RUSTPYTHON; Feedparser.feed -> Feedparser._input.push, Feedparser._call_parse -> Feedparser._parse does not keep _input state between calls
3944 def test_newlines(self):
3945 m = self.parse(['a:\nb:\rc:\r\nd:\n'])
3946 self.assertEqual(m.keys(), ['a', 'b', 'c', 'd'])
3947 m = self.parse(['a:\nb:\rc:\r\nd:'])
3948 self.assertEqual(m.keys(), ['a', 'b', 'c', 'd'])
3949 m = self.parse(['a:\rb', 'c:\n'])
3950 self.assertEqual(m.keys(), ['a', 'bc'])
3951 m = self.parse(['a:\r', 'b:\n'])
3952 self.assertEqual(m.keys(), ['a', 'b'])
3953 m = self.parse(['a:\r', '\nb:\n'])
3954 self.assertEqual(m.keys(), ['a', 'b'])
3955
3956 # Only CR and LF should break header fields
3957 m = self.parse(['a:\x85b:\u2028c:\n'])
3958 self.assertEqual(m.items(), [('a', '\x85b:\u2028c:')])
3959 m = self.parse(['a:\r', 'b:\x85', 'c:\n'])
3960 self.assertEqual(m.items(), [('a', ''), ('b', '\x85c:')])
3961
3962 @unittest.expectedFailure # TODO: RUSTPYTHON
3963 def test_long_lines(self):

Callers

nothing calls this directly

Calls 4

parseMethod · 0.95
assertEqualMethod · 0.45
keysMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected