@@ -1127,12 +1127,14 @@ def test_add_from_string(self):
11271127 # Add a string starting with 'From ' to the mailbox
11281128 key = self ._box .add ('From foo@bar blah\n From: foo\n \n 0\n ' )
11291129 self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1130+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
11301131 self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
11311132
11321133 def test_add_from_bytes (self ):
11331134 # Add a byte string starting with 'From ' to the mailbox
11341135 key = self ._box .add (b'From foo@bar blah\n From: foo\n \n 0\n ' )
11351136 self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1137+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
11361138 self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
11371139
11381140 def test_add_mbox_or_mmdf_message (self ):
@@ -1667,18 +1669,23 @@ def test_initialize_with_unixfrom(self):
16671669 msg = mailbox .Message (_sample_message )
16681670 msg .set_unixfrom ('From foo@bar blah' )
16691671 msg = mailbox .mboxMessage (msg )
1670- self .assertEqual (msg .get_from (), 'foo@bar blah' , msg .get_from ())
1672+ self .assertEqual (msg .get_from (), 'foo@bar blah' )
1673+ self .assertEqual (msg .get_unixfrom (), 'From foo@bar blah' )
16711674
16721675 def test_from (self ):
16731676 # Get and set "From " line
16741677 msg = mailbox .mboxMessage (_sample_message )
16751678 self ._check_from (msg )
1679+ self .assertIsNone (msg .get_unixfrom ())
16761680 msg .set_from ('foo bar' )
16771681 self .assertEqual (msg .get_from (), 'foo bar' )
1682+ self .assertIsNone (msg .get_unixfrom ())
16781683 msg .set_from ('foo@bar' , True )
16791684 self ._check_from (msg , 'foo@bar' )
1685+ self .assertIsNone (msg .get_unixfrom ())
16801686 msg .set_from ('blah@temp' , time .localtime ())
16811687 self ._check_from (msg , 'blah@temp' )
1688+ self .assertIsNone (msg .get_unixfrom ())
16821689
16831690 def test_flags (self ):
16841691 # Use get_flags(), set_flags(), add_flag(), remove_flag()
@@ -1866,6 +1873,7 @@ def test_maildir_to_mboxmmdf(self):
18661873 self .assertEqual (msg .get_flags (), result )
18671874 self .assertEqual (msg .get_from (), 'MAILER-DAEMON %s' %
18681875 time .asctime (time .gmtime (0.0 )))
1876+ self .assertIsNone (msg .get_unixfrom ())
18691877 msg_maildir .set_subdir ('cur' )
18701878 self .assertEqual (class_ (msg_maildir ).get_flags (), 'RODFA' )
18711879
@@ -1914,10 +1922,12 @@ def test_mboxmmdf_to_mboxmmdf(self):
19141922 msg_mboxMMDF = class_ (_sample_message )
19151923 msg_mboxMMDF .set_flags ('RODFA' )
19161924 msg_mboxMMDF .set_from ('foo@bar' )
1925+ self .assertIsNone (msg_mboxMMDF .get_unixfrom ())
19171926 for class2_ in (mailbox .mboxMessage , mailbox .MMDFMessage ):
19181927 msg2 = class2_ (msg_mboxMMDF )
19191928 self .assertEqual (msg2 .get_flags (), 'RODFA' )
19201929 self .assertEqual (msg2 .get_from (), 'foo@bar' )
1930+ self .assertIsNone (msg2 .get_unixfrom ())
19211931
19221932 def test_mboxmmdf_to_mh (self ):
19231933 # Convert mboxMessage and MMDFMessage to MHMessage
0 commit comments