@@ -1027,12 +1027,14 @@ def test_add_from_string(self):
1027
1027
# Add a string starting with 'From ' to the mailbox
1028
1028
key = self ._box .add ('From foo@bar blah\n From: foo\n \n 0\n ' )
1029
1029
self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1030
+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
1030
1031
self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
1031
1032
1032
1033
def test_add_from_bytes (self ):
1033
1034
# Add a byte string starting with 'From ' to the mailbox
1034
1035
key = self ._box .add (b'From foo@bar blah\n From: foo\n \n 0\n ' )
1035
1036
self .assertEqual (self ._box [key ].get_from (), 'foo@bar blah' )
1037
+ self .assertEqual (self ._box [key ].get_unixfrom (), 'From foo@bar blah' )
1036
1038
self .assertEqual (self ._box [key ].get_payload (), '0\n ' )
1037
1039
1038
1040
def test_add_mbox_or_mmdf_message (self ):
@@ -1545,18 +1547,23 @@ def test_initialize_with_unixfrom(self):
1545
1547
msg = mailbox .Message (_sample_message )
1546
1548
msg .set_unixfrom ('From foo@bar blah' )
1547
1549
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' )
1549
1552
1550
1553
def test_from (self ):
1551
1554
# Get and set "From " line
1552
1555
msg = mailbox .mboxMessage (_sample_message )
1553
1556
self ._check_from (msg )
1557
+ self .assertIsNone (msg .get_unixfrom ())
1554
1558
msg .set_from ('foo bar' )
1555
1559
self .assertEqual (msg .get_from (), 'foo bar' )
1560
+ self .assertIsNone (msg .get_unixfrom ())
1556
1561
msg .set_from ('foo@bar' , True )
1557
1562
self ._check_from (msg , 'foo@bar' )
1563
+ self .assertIsNone (msg .get_unixfrom ())
1558
1564
msg .set_from ('blah@temp' , time .localtime ())
1559
1565
self ._check_from (msg , 'blah@temp' )
1566
+ self .assertIsNone (msg .get_unixfrom ())
1560
1567
1561
1568
def test_flags (self ):
1562
1569
# Use get_flags(), set_flags(), add_flag(), remove_flag()
@@ -1744,6 +1751,7 @@ def test_maildir_to_mboxmmdf(self):
1744
1751
self .assertEqual (msg .get_flags (), result )
1745
1752
self .assertEqual (msg .get_from (), 'MAILER-DAEMON %s' %
1746
1753
time .asctime (time .gmtime (0.0 )))
1754
+ self .assertIsNone (msg .get_unixfrom ())
1747
1755
msg_maildir .set_subdir ('cur' )
1748
1756
self .assertEqual (class_ (msg_maildir ).get_flags (), 'RODFA' )
1749
1757
@@ -1792,10 +1800,12 @@ def test_mboxmmdf_to_mboxmmdf(self):
1792
1800
msg_mboxMMDF = class_ (_sample_message )
1793
1801
msg_mboxMMDF .set_flags ('RODFA' )
1794
1802
msg_mboxMMDF .set_from ('foo@bar' )
1803
+ self .assertIsNone (msg_mboxMMDF .get_unixfrom ())
1795
1804
for class2_ in (mailbox .mboxMessage , mailbox .MMDFMessage ):
1796
1805
msg2 = class2_ (msg_mboxMMDF )
1797
1806
self .assertEqual (msg2 .get_flags (), 'RODFA' )
1798
1807
self .assertEqual (msg2 .get_from (), 'foo@bar' )
1808
+ self .assertIsNone (msg2 .get_unixfrom ())
1799
1809
1800
1810
def test_mboxmmdf_to_mh (self ):
1801
1811
# Convert mboxMessage and MMDFMessage to MHMessage
0 commit comments