MCPcopy Index your code
hub / github.com/python/cpython / test_as_string_policy

Method test_as_string_policy

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

Source from the content-addressed store, hash-verified

308 self.assertEqual(text, NL.join(lines[1:]))
309
310 def test_as_string_policy(self):
311 msg = self._msgobj('msg_01.txt')
312 newpolicy = msg.policy.clone(linesep='\r\n')
313 fullrepr = msg.as_string(policy=newpolicy)
314 s = StringIO()
315 g = Generator(s, policy=newpolicy)
316 g.flatten(msg)
317 self.assertEqual(fullrepr, s.getvalue())
318
319 def test_nonascii_as_string_without_cte(self):
320 m = textwrap.dedent("""\

Callers

nothing calls this directly

Calls 8

flattenMethod · 0.95
getvalueMethod · 0.95
StringIOClass · 0.90
GeneratorClass · 0.90
_msgobjMethod · 0.45
cloneMethod · 0.45
as_stringMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected