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
6c4a7c68
Kaydet (Commit)
6c4a7c68
authored
Nis 09, 2008
tarafından
Trent Nelson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix typo with regards to self.PORT shadowing class variables with the same name.
üst
79e42a0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
test_httplib.py
Lib/test/test_httplib.py
+5
-4
test_socket_ssl.py
Lib/test/test_socket_ssl.py
+3
-3
No files found.
Lib/test/test_httplib.py
Dosyayı görüntüle @
6c4a7c68
...
@@ -203,7 +203,7 @@ class TimeoutTest(TestCase):
...
@@ -203,7 +203,7 @@ class TimeoutTest(TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
serv
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
serv
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
PORT
=
test_support
.
bind_port
(
self
.
serv
)
TimeoutTest
.
PORT
=
test_support
.
bind_port
(
self
.
serv
)
self
.
serv
.
listen
(
5
)
self
.
serv
.
listen
(
5
)
def
tearDown
(
self
):
def
tearDown
(
self
):
...
@@ -215,13 +215,13 @@ class TimeoutTest(TestCase):
...
@@ -215,13 +215,13 @@ class TimeoutTest(TestCase):
HTTPConnection and into the socket.
HTTPConnection and into the socket.
'''
'''
# default
# default
httpConn
=
httplib
.
HTTPConnection
(
HOST
,
self
.
PORT
)
httpConn
=
httplib
.
HTTPConnection
(
HOST
,
TimeoutTest
.
PORT
)
httpConn
.
connect
()
httpConn
.
connect
()
self
.
assertTrue
(
httpConn
.
sock
.
gettimeout
()
is
None
)
self
.
assertTrue
(
httpConn
.
sock
.
gettimeout
()
is
None
)
httpConn
.
close
()
httpConn
.
close
()
# a value
# a value
httpConn
=
httplib
.
HTTPConnection
(
HOST
,
self
.
PORT
,
timeout
=
30
)
httpConn
=
httplib
.
HTTPConnection
(
HOST
,
TimeoutTest
.
PORT
,
timeout
=
30
)
httpConn
.
connect
()
httpConn
.
connect
()
self
.
assertEqual
(
httpConn
.
sock
.
gettimeout
(),
30
)
self
.
assertEqual
(
httpConn
.
sock
.
gettimeout
(),
30
)
httpConn
.
close
()
httpConn
.
close
()
...
@@ -230,7 +230,8 @@ class TimeoutTest(TestCase):
...
@@ -230,7 +230,8 @@ class TimeoutTest(TestCase):
previous
=
socket
.
getdefaulttimeout
()
previous
=
socket
.
getdefaulttimeout
()
socket
.
setdefaulttimeout
(
30
)
socket
.
setdefaulttimeout
(
30
)
try
:
try
:
httpConn
=
httplib
.
HTTPConnection
(
HOST
,
self
.
PORT
,
timeout
=
None
)
httpConn
=
httplib
.
HTTPConnection
(
HOST
,
TimeoutTest
.
PORT
,
timeout
=
None
)
httpConn
.
connect
()
httpConn
.
connect
()
finally
:
finally
:
socket
.
setdefaulttimeout
(
previous
)
socket
.
setdefaulttimeout
(
previous
)
...
...
Lib/test/test_socket_ssl.py
Dosyayı görüntüle @
6c4a7c68
...
@@ -212,8 +212,8 @@ class OpenSSLServer(threading.Thread):
...
@@ -212,8 +212,8 @@ class OpenSSLServer(threading.Thread):
try
:
try
:
# XXX TODO: on Windows, this should make more effort to use the
# XXX TODO: on Windows, this should make more effort to use the
# openssl.exe that would have been built by the pcbuild.sln.
# openssl.exe that would have been built by the pcbuild.sln.
self
.
PORT
=
test_support
.
find_unused_port
()
OpenSSLServer
.
PORT
=
test_support
.
find_unused_port
()
args
=
(
self
.
PORT
,
cert_file
,
key_file
)
args
=
(
OpenSSLServer
.
PORT
,
cert_file
,
key_file
)
cmd
=
"openssl s_server -accept
%
d -cert
%
s -key
%
s -quiet"
%
args
cmd
=
"openssl s_server -accept
%
d -cert
%
s -key
%
s -quiet"
%
args
self
.
s
=
subprocess
.
Popen
(
cmd
.
split
(),
stdin
=
subprocess
.
PIPE
,
self
.
s
=
subprocess
.
Popen
(
cmd
.
split
(),
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
...
@@ -225,7 +225,7 @@ class OpenSSLServer(threading.Thread):
...
@@ -225,7 +225,7 @@ class OpenSSLServer(threading.Thread):
# let's try if it is actually up
# let's try if it is actually up
try
:
try
:
s
=
socket
.
socket
()
s
=
socket
.
socket
()
s
.
connect
((
HOST
,
self
.
PORT
))
s
.
connect
((
HOST
,
OpenSSLServer
.
PORT
))
s
.
close
()
s
.
close
()
if
self
.
s
.
stdout
.
readline
()
!=
"ERROR
\n
"
:
if
self
.
s
.
stdout
.
readline
()
!=
"ERROR
\n
"
:
raise
ValueError
raise
ValueError
...
...
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