Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
93e6a3d2
Kaydet (Commit)
93e6a3d2
authored
Agu 10, 2011
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove the un-exercised in-module test code.
üst
ea75f4cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
68 deletions
+0
-68
httplib.py
Lib/httplib.py
+0
-68
No files found.
Lib/httplib.py
Dosyayı görüntüle @
93e6a3d2
...
...
@@ -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