[Python-3000-checkins] r63096 - python/branches/py3k/Lib/test/test_mailbox.py

georg.brandl python-3000-checkins at python.org
Sun May 11 23:31:44 CEST 2008


Author: georg.brandl
Date: Sun May 11 23:31:44 2008
New Revision: 63096

Log:
Remove rfc822 dependency in test.


Modified:
   python/branches/py3k/Lib/test/test_mailbox.py

Modified: python/branches/py3k/Lib/test/test_mailbox.py
==============================================================================
--- python/branches/py3k/Lib/test/test_mailbox.py	(original)
+++ python/branches/py3k/Lib/test/test_mailbox.py	Sun May 11 23:31:44 2008
@@ -5,7 +5,6 @@
 import socket
 import email
 import email.message
-import rfc822
 import re
 import io
 from test import test_support
@@ -131,11 +130,11 @@
         self.assert_(self._box.get('foo') is None)
         self.assert_(self._box.get('foo', False) is False)
         self._box.close()
-        self._box = self._factory(self._path, factory=rfc822.Message)
+        self._box = self._factory(self._path)
         key1 = self._box.add(self._template % 1)
         msg = self._box.get(key1)
         self.assertEqual(msg['from'], 'foo')
-        self.assertEqual(msg.fp.read(), '1')
+        self.assertEqual(msg.get_payload(), '1')
 
     def test_getitem(self):
         # Retrieve message using __getitem__()
@@ -526,7 +525,7 @@
         # Initialize a non-existent mailbox
         self.tearDown()
         self._box = mailbox.Maildir(self._path)
-        self._check_basics(factory=rfc822.Message)
+        self._check_basics()
         self._delete_recursively(self._path)
         self._box = self._factory(self._path, factory=None)
         self._check_basics()
@@ -537,8 +536,6 @@
         for subdir in '', 'tmp', 'new', 'cur':
             os.mkdir(os.path.normpath(os.path.join(self._path, subdir)))
         self._box = mailbox.Maildir(self._path)
-        self._check_basics(factory=rfc822.Message)
-        self._box = mailbox.Maildir(self._path, factory=None)
         self._check_basics()
 
     def _check_basics(self, factory=None):


More information about the Python-3000-checkins mailing list