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

Method test_as_bytes_policy

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

Source from the content-addressed store, hash-verified

377 self.assertEqual(data, b'\n'.join(lines[1:]))
378
379 def test_as_bytes_policy(self):
380 msg = self._msgobj('msg_01.txt')
381 newpolicy = msg.policy.clone(linesep='\r\n')
382 fullrepr = msg.as_bytes(policy=newpolicy)
383 s = BytesIO()
384 g = BytesGenerator(s,policy=newpolicy)
385 g.flatten(msg)
386 self.assertEqual(fullrepr, s.getvalue())
387
388 # test_headerregistry.TestContentTypeHeader.bad_params
389 def test_bad_param(self):

Callers

nothing calls this directly

Calls 8

getvalueMethod · 0.95
BytesIOClass · 0.90
BytesGeneratorClass · 0.90
as_bytesMethod · 0.80
_msgobjMethod · 0.45
cloneMethod · 0.45
flattenMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected