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
150acda5
Kaydet (Commit)
150acda5
authored
Nis 27, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove uses of find_unused_port() in test_ssl, and small cleanups
üst
47b5440f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
test_ssl.py
Lib/test/test_ssl.py
+17
-19
No files found.
Lib/test/test_ssl.py
Dosyayı görüntüle @
150acda5
...
@@ -696,9 +696,9 @@ else:
...
@@ -696,9 +696,9 @@ else:
self
.
flag
=
None
self
.
flag
=
None
self
.
active
=
False
self
.
active
=
False
self
.
RootedHTTPRequestHandler
.
root
=
os
.
path
.
split
(
CERTFILE
)[
0
]
self
.
RootedHTTPRequestHandler
.
root
=
os
.
path
.
split
(
CERTFILE
)[
0
]
self
.
port
=
test_support
.
find_unused_port
()
self
.
server
=
self
.
HTTPSServer
(
self
.
server
=
self
.
HTTPSServer
(
(
HOST
,
self
.
port
),
self
.
RootedHTTPRequestHandler
,
certfile
)
(
HOST
,
0
),
self
.
RootedHTTPRequestHandler
,
certfile
)
self
.
port
=
self
.
server
.
server_port
threading
.
Thread
.
__init__
(
self
)
threading
.
Thread
.
__init__
(
self
)
self
.
daemon
=
True
self
.
daemon
=
True
...
@@ -851,28 +851,28 @@ else:
...
@@ -851,28 +851,28 @@ else:
listener_ready
=
threading
.
Event
()
listener_ready
=
threading
.
Event
()
listener_gone
=
threading
.
Event
()
listener_gone
=
threading
.
Event
()
port
=
test_support
.
find_unused_port
()
# `listener` runs in a thread. It opens a socket listening on
s
=
socket
.
socket
()
# PORT, and sits in an accept() until the main thread connects.
port
=
test_support
.
bind_port
(
s
,
HOST
)
# Then it rudely closes the socket, and sets Event `listener_gone`
# to let the main thread know the socket is gone.
# `listener` runs in a thread. It sits in an accept() until
# the main thread connects. Then it rudely closes the socket,
# and sets Event `listener_gone` to let the main thread know
# the socket is gone.
def
listener
():
def
listener
():
s
=
socket
.
socket
()
s
.
bind
((
HOST
,
port
))
s
.
listen
(
5
)
s
.
listen
(
5
)
listener_ready
.
set
()
listener_ready
.
set
()
s
.
accept
()
s
.
accept
()
s
=
None
# reclaim the socket object, which also closes it
s
.
close
()
listener_gone
.
set
()
listener_gone
.
set
()
def
connector
():
def
connector
():
listener_ready
.
wait
()
listener_ready
.
wait
()
s
=
socket
.
socket
()
c
=
socket
.
socket
()
s
.
connect
((
HOST
,
port
))
c
.
connect
((
HOST
,
port
))
listener_gone
.
wait
()
listener_gone
.
wait
()
try
:
try
:
ssl_sock
=
ssl
.
wrap_socket
(
s
)
ssl_sock
=
ssl
.
wrap_socket
(
c
)
except
IOError
:
except
IOError
:
pass
pass
else
:
else
:
...
@@ -881,8 +881,10 @@ else:
...
@@ -881,8 +881,10 @@ else:
t
=
threading
.
Thread
(
target
=
listener
)
t
=
threading
.
Thread
(
target
=
listener
)
t
.
start
()
t
.
start
()
connector
()
try
:
t
.
join
()
connector
()
finally
:
t
.
join
()
def
testEcho
(
self
):
def
testEcho
(
self
):
...
@@ -1354,10 +1356,6 @@ def test_main(verbose=False):
...
@@ -1354,10 +1356,6 @@ def test_main(verbose=False):
not
os
.
path
.
exists
(
SVN_PYTHON_ORG_ROOT_CERT
)):
not
os
.
path
.
exists
(
SVN_PYTHON_ORG_ROOT_CERT
)):
raise
test_support
.
TestFailed
(
"Can't read certificate files!"
)
raise
test_support
.
TestFailed
(
"Can't read certificate files!"
)
TESTPORT
=
test_support
.
find_unused_port
()
if
not
TESTPORT
:
raise
test_support
.
TestFailed
(
"Can't find open port to test servers on!"
)
tests
=
[
BasicTests
]
tests
=
[
BasicTests
]
if
test_support
.
is_resource_enabled
(
'network'
):
if
test_support
.
is_resource_enabled
(
'network'
):
...
...
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