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
e324c573
Commit
e324c573
authored
Jul 31, 2011
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using support.transient_internet helper method in the urllib2net test.
parent
59256329
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
Lib/test/test_urllib2net.py
Lib/test/test_urllib2net.py
+14
-10
No files found.
Lib/test/test_urllib2net.py
View file @
e324c573
...
@@ -178,17 +178,21 @@ class OtherNetworkTests(unittest.TestCase):
...
@@ -178,17 +178,21 @@ class OtherNetworkTests(unittest.TestCase):
# Some sites do not send Connection: close header.
# Some sites do not send Connection: close header.
# Verify that those work properly. (#issue12576)
# Verify that those work properly. (#issue12576)
try
:
URL
=
'http://www.imdb.com'
# mangles Connection:close
with
urllib
.
request
.
urlopen
(
'http://www.imdb.com'
)
as
res
:
pass
with
support
.
transient_internet
(
URL
):
except
ValueError
as
e
:
try
:
self
.
fail
(
"urlopen failed for sites not sending Connection:close"
)
with
urllib
.
request
.
urlopen
(
URL
)
as
res
:
else
:
pass
self
.
assertTrue
(
res
)
except
ValueError
as
e
:
self
.
fail
(
"urlopen failed for site not sending
\
Connection:close"
)
else
:
self
.
assertTrue
(
res
)
req
=
urllib
.
request
.
urlopen
(
'http://www.imdb.com'
)
req
=
urllib
.
request
.
urlopen
(
URL
)
res
=
req
.
read
()
res
=
req
.
read
()
self
.
assertTrue
(
res
)
self
.
assertTrue
(
res
)
def
_test_urls
(
self
,
urls
,
handlers
,
retry
=
True
):
def
_test_urls
(
self
,
urls
,
handlers
,
retry
=
True
):
import
time
import
time
...
...
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