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
05c511f1
Kaydet (Commit)
05c511f1
authored
Kas 01, 2013
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: Slight rearrangement of tests for server_hostname=...
üst
28dff0d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+4
-3
No files found.
Lib/test/test_asyncio/test_base_events.py
Dosyayı görüntüle @
05c511f1
...
@@ -444,7 +444,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
...
@@ -444,7 +444,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
self
.
assertRaises
(
self
.
assertRaises
(
OSError
,
self
.
loop
.
run_until_complete
,
coro
)
OSError
,
self
.
loop
.
run_until_complete
,
coro
)
def
test_create_connection_server_hostname_default
(
self
):
def
test_create_connection_s
sl_s
erver_hostname_default
(
self
):
self
.
loop
.
getaddrinfo
=
unittest
.
mock
.
Mock
()
self
.
loop
.
getaddrinfo
=
unittest
.
mock
.
Mock
()
def
mock_getaddrinfo
(
*
args
,
**
kwds
):
def
mock_getaddrinfo
(
*
args
,
**
kwds
):
...
@@ -490,8 +490,8 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
...
@@ -490,8 +490,8 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
server_side
=
False
,
server_side
=
False
,
server_hostname
=
''
)
server_hostname
=
''
)
def
test_create_connection_server_hostname_errors
(
self
):
def
test_create_connection_
no_ssl_
server_hostname_errors
(
self
):
# When not using ssl, server_hostname must be None
(but '' is OK)
.
# When not using ssl, server_hostname must be None.
coro
=
self
.
loop
.
create_connection
(
MyProto
,
'python.org'
,
80
,
coro
=
self
.
loop
.
create_connection
(
MyProto
,
'python.org'
,
80
,
server_hostname
=
''
)
server_hostname
=
''
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
coro
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
coro
)
...
@@ -499,6 +499,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
...
@@ -499,6 +499,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
server_hostname
=
'python.org'
)
server_hostname
=
'python.org'
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
coro
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
coro
)
def
test_create_connection_ssl_server_hostname_errors
(
self
):
# When using ssl, server_hostname may be None if host is non-empty.
# When using ssl, server_hostname may be None if host is non-empty.
coro
=
self
.
loop
.
create_connection
(
MyProto
,
''
,
80
,
ssl
=
True
)
coro
=
self
.
loop
.
create_connection
(
MyProto
,
''
,
80
,
ssl
=
True
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
coro
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
coro
)
...
...
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