summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-11 21:31:44 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-11 21:31:44 (GMT)
commitfb16cf1d9b6d3f5e8d48b19409f083435973d9c0 (patch)
treed766258dac07d9f382f7d907d13df0e431d542a2
parent5807c415c5b16b9119895cdc80c4608f37c8c30b (diff)
downloadcpython-fb16cf1d9b6d3f5e8d48b19409f083435973d9c0.zip
cpython-fb16cf1d9b6d3f5e8d48b19409f083435973d9c0.tar.gz
cpython-fb16cf1d9b6d3f5e8d48b19409f083435973d9c0.tar.bz2
Remove rfc822 dependency in test.
-rw-r--r--Lib/test/test_mailbox.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index e14516d..43b864c 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -5,7 +5,6 @@ import stat
import socket
import email
import email.message
-import rfc822
import re
import io
from test import test_support
@@ -131,11 +130,11 @@ class TestMailbox(TestBase):
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 @@ class TestMaildir(TestMailbox):
# 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 @@ class TestMaildir(TestMailbox):
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):