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
f8d370e3
Commit
f8d370e3
authored
Oct 27, 2012
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some tests in 2.7 for Issue #16250
parent
e9992292
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
Lib/test/test_urllib.py
Lib/test/test_urllib.py
+21
-0
No files found.
Lib/test/test_urllib.py
View file @
f8d370e3
...
...
@@ -222,6 +222,27 @@ Content-Type: text/html; charset=iso-8859-1
finally
:
self
.
unfakehttp
()
def
test_missing_localfile
(
self
):
self
.
assertRaises
(
IOError
,
urllib
.
urlopen
,
'file://localhost/a/missing/file.py'
)
fd
,
tmp_file
=
tempfile
.
mkstemp
()
tmp_fileurl
=
'file://localhost/'
+
tmp_file
.
replace
(
os
.
path
.
sep
,
'/'
)
try
:
self
.
assertTrue
(
os
.
path
.
exists
(
tmp_file
))
fp
=
urllib
.
urlopen
(
tmp_fileurl
)
finally
:
os
.
close
(
fd
)
fp
.
close
()
os
.
unlink
(
tmp_file
)
self
.
assertFalse
(
os
.
path
.
exists
(
tmp_file
))
self
.
assertRaises
(
IOError
,
urllib
.
urlopen
,
tmp_fileurl
)
def
test_ftp_nonexisting
(
self
):
self
.
assertRaises
(
IOError
,
urllib
.
urlopen
,
'ftp://localhost/not/existing/file.py'
)
def
test_userpass_inurl
(
self
):
self
.
fakehttp
(
'Hello!'
)
try
:
...
...
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