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

Method test_from

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

Source from the content-addressed store, hash-verified

1714 self.assertEqual(msg.get_unixfrom(), 'From foo@bar blah')
1715
1716 def test_from(self):
1717 # Get and set "From " line
1718 msg = mailbox.mboxMessage(_sample_message)
1719 self._check_from(msg)
1720 self.assertIsNone(msg.get_unixfrom())
1721 msg.set_from('foo bar')
1722 self.assertEqual(msg.get_from(), 'foo bar')
1723 self.assertIsNone(msg.get_unixfrom())
1724 msg.set_from('foo@bar', True)
1725 self._check_from(msg, 'foo@bar')
1726 self.assertIsNone(msg.get_unixfrom())
1727 msg.set_from('blah@temp', time.localtime())
1728 self._check_from(msg, 'blah@temp')
1729 self.assertIsNone(msg.get_unixfrom())
1730
1731 def test_flags(self):
1732 # 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