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

Method test_as_string

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

Source from the content-addressed store, hash-verified

298 self.assertIn('TO', msg)
299
300 def test_as_string(self):
301 msg = self._msgobj('msg_01.txt')
302 with openfile('msg_01.txt', encoding="utf-8") as fp:
303 text = fp.read()
304 self.assertEqual(text, str(msg))
305 fullrepr = msg.as_string(unixfrom=True)
306 lines = fullrepr.split('\n')
307 self.assertStartsWith(lines[0], 'From ')
308 self.assertEqual(text, NL.join(lines[1:]))
309
310 def test_as_string_policy(self):
311 msg = self._msgobj('msg_01.txt')

Callers

nothing calls this directly

Calls 9

openfileFunction · 0.90
strFunction · 0.85
assertStartsWithMethod · 0.80
_msgobjMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45
as_stringMethod · 0.45
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected