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
7d81bf69
Commit
7d81bf69
authored
Aug 10, 2011
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the un-exercised in-module test code.
parent
8a84a2d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
68 deletions
+0
-68
Lib/httplib.py
Lib/httplib.py
+0
-68
No files found.
Lib/httplib.py
View file @
7d81bf69
...
...
@@ -1322,71 +1322,3 @@ class LineAndFileWrapper:
return
L
+
self
.
_file
.
readlines
()
else
:
return
L
+
self
.
_file
.
readlines
(
size
)
def
test
():
"""Test this module.
A hodge podge of tests collected here, because they have too many
external dependencies for the regular test suite.
"""
import
sys
import
getopt
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'd'
)
dl
=
0
for
o
,
a
in
opts
:
if
o
==
'-d'
:
dl
=
dl
+
1
host
=
'www.python.org'
selector
=
'/'
if
args
[
0
:]:
host
=
args
[
0
]
if
args
[
1
:]:
selector
=
args
[
1
]
h
=
HTTP
()
h
.
set_debuglevel
(
dl
)
h
.
connect
(
host
)
h
.
putrequest
(
'GET'
,
selector
)
h
.
endheaders
()
status
,
reason
,
headers
=
h
.
getreply
()
print
'status ='
,
status
print
'reason ='
,
reason
print
"read"
,
len
(
h
.
getfile
().
read
())
print
if
headers
:
for
header
in
headers
.
headers
:
print
header
.
strip
()
print
# minimal test that code to extract host from url works
class
HTTP11
(
HTTP
):
_http_vsn
=
11
_http_vsn_str
=
'HTTP/1.1'
h
=
HTTP11
(
'www.python.org'
)
h
.
putrequest
(
'GET'
,
'http://www.python.org/~jeremy/'
)
h
.
endheaders
()
h
.
getreply
()
h
.
close
()
try
:
import
ssl
except
ImportError
:
pass
else
:
for
host
,
selector
in
((
'sourceforge.net'
,
'/projects/python'
),
):
print
"https://%s%s"
%
(
host
,
selector
)
hs
=
HTTPS
()
hs
.
set_debuglevel
(
dl
)
hs
.
connect
(
host
)
hs
.
putrequest
(
'GET'
,
selector
)
hs
.
endheaders
()
status
,
reason
,
headers
=
hs
.
getreply
()
print
'status ='
,
status
print
'reason ='
,
reason
print
"read"
,
len
(
hs
.
getfile
().
read
())
print
if
headers
:
for
header
in
headers
.
headers
:
print
header
.
strip
()
print
if
__name__
==
'__main__'
:
test
()
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