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

Method test_from

Lib/test/test_mailbox.py:1731–1744  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1729 self.assertEqual(msg.get_unixfrom(), 'From foo@bar blah')
1730
1731 def test_from(self):
1732 # Get and set "From " line
1733 msg = mailbox.mboxMessage(_sample_message)
1734 self._check_from(msg)
1735 self.assertIsNone(msg.get_unixfrom())
1736 msg.set_from('foo bar')
1737 self.assertEqual(msg.get_from(), 'foo bar')
1738 self.assertIsNone(msg.get_unixfrom())
1739 msg.set_from('foo@bar', True)
1740 self._check_from(msg, 'foo@bar')
1741 self.assertIsNone(msg.get_unixfrom())
1742 msg.set_from('blah@temp', time.localtime())
1743 self._check_from(msg, 'blah@temp')
1744 self.assertIsNone(msg.get_unixfrom())
1745
1746 def test_flags(self):
1747 # Use get_flags(), set_flags(), add_flag(), remove_flag()

Callers

nothing calls this directly

Calls 6

_check_fromMethod · 0.95
assertIsNoneMethod · 0.80
get_unixfromMethod · 0.80
set_fromMethod · 0.80
get_fromMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected