Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fb16cf1d
Commit
fb16cf1d
authored
May 11, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove rfc822 dependency in test.
parent
5807c415
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
Lib/test/test_mailbox.py
Lib/test/test_mailbox.py
+3
-6
No files found.
Lib/test/test_mailbox.py
View file @
fb16cf1d
...
...
@@ -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
.
re
ad
(),
'1'
)
self
.
assertEqual
(
msg
.
get_paylo
ad
(),
'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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment