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
28346b80
Commit
28346b80
authored
Mar 31, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only a few files were opened using findfile; consistently don't use it.
parent
dd810ddb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
Lib/test/test_email/test_email.py
Lib/test/test_email/test_email.py
+5
-11
No files found.
Lib/test/test_email/test_email.py
View file @
28346b80
...
...
@@ -36,7 +36,7 @@ from email import iterators
from
email
import
base64mime
from
email
import
quoprimime
from
test.support
import
findfile
,
run_unittest
,
unlink
from
test.support
import
run_unittest
,
unlink
from
test.test_email
import
__file__
as
landmark
...
...
@@ -65,7 +65,7 @@ class TestEmailBase(unittest.TestCase):
raise
self
.
failureException
(
NL
+
NL
.
join
(
diff
))
def
_msgobj
(
self
,
filename
):
with
openfile
(
fi
ndfile
(
filename
)
)
as
fp
:
with
openfile
(
fi
lename
)
as
fp
:
return
email
.
message_from_file
(
fp
)
...
...
@@ -194,7 +194,7 @@ class TestMessageAPI(TestEmailBase):
def
test_message_rfc822_only
(
self
):
# Issue 7970: message/rfc822 not in multipart parsed by
# HeaderParser caused an exception when flattened.
with
openfile
(
findfile
(
'msg_46.txt'
)
)
as
fp
:
with
openfile
(
'msg_46.txt'
)
as
fp
:
msgdata
=
fp
.
read
()
parser
=
HeaderParser
()
msg
=
parser
.
parsestr
(
msgdata
)
...
...
@@ -1055,13 +1055,7 @@ Blah blah blah
# Test the basic MIMEAudio class
class
TestMIMEAudio
(
unittest
.
TestCase
):
def
setUp
(
self
):
# Make sure we pick up the audiotest.au that lives in email/test/data.
# In Python, there's an audiotest.au living in Lib/test but that isn't
# included in some binary distros that don't include the test
# package. The trailing empty string on the .join() is significant
# since findfile() will do a dirname().
datadir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
landmark
),
'data'
,
''
)
with
open
(
findfile
(
'audiotest.au'
,
datadir
),
'rb'
)
as
fp
:
with
openfile
(
'audiotest.au'
,
'rb'
)
as
fp
:
self
.
_audiodata
=
fp
.
read
()
self
.
_au
=
MIMEAudio
(
self
.
_audiodata
)
...
...
@@ -4320,7 +4314,7 @@ Content-Type: application/x-foo;
class
TestSigned
(
TestEmailBase
):
def
_msg_and_obj
(
self
,
filename
):
with
openfile
(
fi
ndfile
(
filename
)
)
as
fp
:
with
openfile
(
fi
lename
)
as
fp
:
original
=
fp
.
read
()
msg
=
email
.
message_from_string
(
original
)
return
original
,
msg
...
...
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