Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb16cf1

Browse files
committed
Remove rfc822 dependency in test.
1 parent 5807c41 commit fb16cf1

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Lib/test/test_mailbox.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import socket
66
import email
77
import email.message
8-
import rfc822
98
import re
109
import io
1110
from test import test_support
@@ -131,11 +130,11 @@ def test_get(self):
131130
self.assert_(self._box.get('foo') is None)
132131
self.assert_(self._box.get('foo', False) is False)
133132
self._box.close()
134-
self._box = self._factory(self._path, factory=rfc822.Message)
133+
self._box = self._factory(self._path)
135134
key1 = self._box.add(self._template % 1)
136135
msg = self._box.get(key1)
137136
self.assertEqual(msg['from'], 'foo')
138-
self.assertEqual(msg.fp.read(), '1')
137+
self.assertEqual(msg.get_payload(), '1')
139138

140139
def test_getitem(self):
141140
# Retrieve message using __getitem__()
@@ -526,7 +525,7 @@ def test_initialize_new(self):
526525
# Initialize a non-existent mailbox
527526
self.tearDown()
528527
self._box = mailbox.Maildir(self._path)
529-
self._check_basics(factory=rfc822.Message)
528+
self._check_basics()
530529
self._delete_recursively(self._path)
531530
self._box = self._factory(self._path, factory=None)
532531
self._check_basics()
@@ -537,8 +536,6 @@ def test_initialize_existing(self):
537536
for subdir in '', 'tmp', 'new', 'cur':
538537
os.mkdir(os.path.normpath(os.path.join(self._path, subdir)))
539538
self._box = mailbox.Maildir(self._path)
540-
self._check_basics(factory=rfc822.Message)
541-
self._box = mailbox.Maildir(self._path, factory=None)
542539
self._check_basics()
543540

544541
def _check_basics(self, factory=None):

0 commit comments

Comments
 (0)