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
a96fd482
Commit
a96fd482
authored
Feb 19, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.2 (#20695)
parents
665a2bcd
1b94030b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/test/test_urllibnet.py
Lib/test/test_urllibnet.py
+4
-4
No files found.
Lib/test/test_urllibnet.py
View file @
a96fd482
...
...
@@ -103,7 +103,7 @@ class urlopenNetworkTests(unittest.TestCase):
# Make sure fd returned by fileno is valid.
with
self
.
urlopen
(
"http://www.python.org/"
,
timeout
=
None
)
as
open_url
:
fd
=
open_url
.
fileno
()
with
os
.
fdopen
(
fd
,
encoding
=
'utf-8
'
)
as
f
:
with
os
.
fdopen
(
fd
,
'rb
'
)
as
f
:
self
.
assertTrue
(
f
.
read
(),
"reading from file created using fd "
"returned by fileno failed"
)
...
...
@@ -151,7 +151,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
with
self
.
urlretrieve
(
"http://www.python.org/"
)
as
(
file_location
,
info
):
self
.
assertTrue
(
os
.
path
.
exists
(
file_location
),
"file location returned by"
" urlretrieve is not a valid path"
)
with
open
(
file_location
,
encoding
=
'utf-8
'
)
as
f
:
with
open
(
file_location
,
'rb
'
)
as
f
:
self
.
assertTrue
(
f
.
read
(),
"reading from the file location returned"
" by urlretrieve failed"
)
...
...
@@ -161,7 +161,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
support
.
TESTFN
)
as
(
file_location
,
info
):
self
.
assertEqual
(
file_location
,
support
.
TESTFN
)
self
.
assertTrue
(
os
.
path
.
exists
(
file_location
))
with
open
(
file_location
,
encoding
=
'utf-8
'
)
as
f
:
with
open
(
file_location
,
'rb
'
)
as
f
:
self
.
assertTrue
(
f
.
read
(),
"reading from temporary file failed"
)
def
test_header
(
self
):
...
...
@@ -170,7 +170,7 @@ class urlretrieveNetworkTests(unittest.TestCase):
self
.
assertIsInstance
(
info
,
email
.
message
.
Message
,
"info is not an instance of email.message.Message"
)
logo
=
"http://www.python.org/
community/
logos/python-logo-master-v3-TM.png"
logo
=
"http://www.python.org/
static/community_
logos/python-logo-master-v3-TM.png"
def
test_data_header
(
self
):
with
self
.
urlretrieve
(
self
.
logo
)
as
(
file_location
,
fileheaders
):
...
...
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