@@ -1127,12 +1127,14 @@ def test_add_from_string(self):
1127
1127
# Add a string starting with 'From ' to the mailbox
1128
1128
key = self ._box .add ('From foo@bar blah\n From: foo\n \n 0\n ' )
1129
1129
self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1130
+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
1130
1131
self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
1131
1132
1132
1133
def test_add_from_bytes (self ):
1133
1134
# Add a byte string starting with 'From ' to the mailbox
1134
1135
key = self ._box .add (b'From foo@bar blah\n From: foo\n \n 0\n ' )
1135
1136
self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1137
+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
1136
1138
self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
1137
1139
1138
1140
def test_add_mbox_or_mmdf_message (self ):
@@ -1667,18 +1669,23 @@ def test_initialize_with_unixfrom(self):
1667
1669
msg = mailbox .Message (_sample_message )
1668
1670
msg .set_unixfrom ('From foo@bar blah' )
1669
1671
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' )
1671
1674
1672
1675
def test_from (self ):
1673
1676
# Get and set "From " line
1674
1677
msg = mailbox .mboxMessage (_sample_message )
1675
1678
self ._check_from (msg )
1679
+ self .assertIsNone (msg .get_unixfrom ())
1676
1680
msg .set_from ('foo bar' )
1677
1681
self .assertEqual (msg .get_from (), 'foo bar' )
1682
+ self .assertIsNone (msg .get_unixfrom ())
1678
1683
msg .set_from ('foo@bar' , True )
1679
1684
self ._check_from (msg , 'foo@bar' )
1685
+ self .assertIsNone (msg .get_unixfrom ())
1680
1686
msg .set_from ('blah@temp' , time .localtime ())
1681
1687
self ._check_from (msg , 'blah@temp' )
1688
+ self .assertIsNone (msg .get_unixfrom ())
1682
1689
1683
1690
def test_flags (self ):
1684
1691
# Use get_flags(), set_flags(), add_flag(), remove_flag()
@@ -1866,6 +1873,7 @@ def test_maildir_to_mboxmmdf(self):
1866
1873
self .assertEqual (msg .get_flags (), result )
1867
1874
self .assertEqual (msg .get_from (), 'MAILER-DAEMON %s' %
1868
1875
time .asctime (time .gmtime (0.0 )))
1876
+ self .assertIsNone (msg .get_unixfrom ())
1869
1877
msg_maildir .set_subdir ('cur' )
1870
1878
self .assertEqual (class_ (msg_maildir ).get_flags (), 'RODFA' )
1871
1879
@@ -1914,10 +1922,12 @@ def test_mboxmmdf_to_mboxmmdf(self):
1914
1922
msg_mboxMMDF = class_ (_sample_message )
1915
1923
msg_mboxMMDF .set_flags ('RODFA' )
1916
1924
msg_mboxMMDF .set_from ('foo@bar' )
1925
+ self .assertIsNone (msg_mboxMMDF .get_unixfrom ())
1917
1926
for class2_ in (mailbox .mboxMessage , mailbox .MMDFMessage ):
1918
1927
msg2 = class2_ (msg_mboxMMDF )
1919
1928
self .assertEqual (msg2 .get_flags (), 'RODFA' )
1920
1929
self .assertEqual (msg2 .get_from (), 'foo@bar' )
1930
+ self .assertIsNone (msg2 .get_unixfrom ())
1921
1931
1922
1932
def test_mboxmmdf_to_mh (self ):
1923
1933
# Convert mboxMessage and MMDFMessage to MHMessage
0 commit comments