@@ -1027,12 +1027,14 @@ def test_add_from_string(self):
10271027 # Add a string starting with 'From ' to the mailbox
10281028 key = self ._box .add ('From foo@bar blah\n From: foo\n \n 0\n ' )
10291029 self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1030+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
10301031 self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
10311032
10321033 def test_add_from_bytes (self ):
10331034 # Add a byte string starting with 'From ' to the mailbox
10341035 key = self ._box .add (b'From foo@bar blah\n From: foo\n \n 0\n ' )
10351036 self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1037+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
10361038 self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
10371039
10381040 def test_add_mbox_or_mmdf_message (self ):
@@ -1545,18 +1547,23 @@ def test_initialize_with_unixfrom(self):
15451547 msg = mailbox .Message (_sample_message )
15461548 msg .set_unixfrom ('From foo@bar blah' )
15471549 msg = mailbox .mboxMessage (msg )
1548- self .assertEqual (msg .get_from (), 'foo@bar blah' , msg .get_from ())
1550+ self .assertEqual (msg .get_from (), 'foo@bar blah' )
1551+ self .assertEqual (msg .get_unixfrom (), 'From foo@bar blah' )
15491552
15501553 def test_from (self ):
15511554 # Get and set "From " line
15521555 msg = mailbox .mboxMessage (_sample_message )
15531556 self ._check_from (msg )
1557+ self .assertIsNone (msg .get_unixfrom ())
15541558 msg .set_from ('foo bar' )
15551559 self .assertEqual (msg .get_from (), 'foo bar' )
1560+ self .assertIsNone (msg .get_unixfrom ())
15561561 msg .set_from ('foo@bar' , True )
15571562 self ._check_from (msg , 'foo@bar' )
1563+ self .assertIsNone (msg .get_unixfrom ())
15581564 msg .set_from ('blah@temp' , time .localtime ())
15591565 self ._check_from (msg , 'blah@temp' )
1566+ self .assertIsNone (msg .get_unixfrom ())
15601567
15611568 def test_flags (self ):
15621569 # Use get_flags(), set_flags(), add_flag(), remove_flag()
@@ -1744,6 +1751,7 @@ def test_maildir_to_mboxmmdf(self):
17441751 self .assertEqual (msg .get_flags (), result )
17451752 self .assertEqual (msg .get_from (), 'MAILER-DAEMON %s' %
17461753 time .asctime (time .gmtime (0.0 )))
1754+ self .assertIsNone (msg .get_unixfrom ())
17471755 msg_maildir .set_subdir ('cur' )
17481756 self .assertEqual (class_ (msg_maildir ).get_flags (), 'RODFA' )
17491757
@@ -1792,10 +1800,12 @@ def test_mboxmmdf_to_mboxmmdf(self):
17921800 msg_mboxMMDF = class_ (_sample_message )
17931801 msg_mboxMMDF .set_flags ('RODFA' )
17941802 msg_mboxMMDF .set_from ('foo@bar' )
1803+ self .assertIsNone (msg_mboxMMDF .get_unixfrom ())
17951804 for class2_ in (mailbox .mboxMessage , mailbox .MMDFMessage ):
17961805 msg2 = class2_ (msg_mboxMMDF )
17971806 self .assertEqual (msg2 .get_flags (), 'RODFA' )
17981807 self .assertEqual (msg2 .get_from (), 'foo@bar' )
1808+ self .assertIsNone (msg2 .get_unixfrom ())
17991809
18001810 def test_mboxmmdf_to_mh (self ):
18011811 # Convert mboxMessage and MMDFMessage to MHMessage
0 commit comments