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
cf25eb14
Kaydet (Commit)
cf25eb14
authored
Ock 27, 2008
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
socket.error doesn't have a headers attribute like ProtocolError.
Handle that situation where we catch socket.errors.
üst
5b25bc05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
test_xmlrpc.py
Lib/test/test_xmlrpc.py
+10
-10
No files found.
Lib/test/test_xmlrpc.py
Dosyayı görüntüle @
cf25eb14
...
...
@@ -397,7 +397,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
# [ch] The test 404 is causing lots of false alarms.
def
XXXtest_404
(
self
):
...
...
@@ -423,7 +423,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_introspection2
(
self
):
try
:
...
...
@@ -435,7 +435,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_introspection3
(
self
):
try
:
...
...
@@ -447,7 +447,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_introspection4
(
self
):
# the SimpleXMLRPCServer doesn't support signatures, but
...
...
@@ -460,7 +460,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_multicall
(
self
):
try
:
...
...
@@ -477,7 +477,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_non_existing_multicall
(
self
):
try
:
...
...
@@ -498,7 +498,7 @@ class SimpleServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_dotted_attribute
(
self
):
# this will raise AttirebuteError because code don't want us to use
...
...
@@ -553,7 +553,7 @@ class FailingServerTestCase(unittest.TestCase):
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
e
.
headers
))
self
.
fail
(
"
%
s
\n
%
s"
%
(
e
,
getattr
(
e
,
"headers"
,
""
)
))
def
test_fail_no_info
(
self
):
# use the broken message class
...
...
@@ -564,7 +564,7 @@ class FailingServerTestCase(unittest.TestCase):
p
.
pow
(
6
,
8
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
error
),
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
if
not
is_unavailable_exception
(
e
)
and
hasattr
(
e
,
"headers"
)
:
# The two server-side error headers shouldn't be sent back in this case
self
.
assertTrue
(
e
.
headers
.
get
(
"X-exception"
)
is
None
)
self
.
assertTrue
(
e
.
headers
.
get
(
"X-traceback"
)
is
None
)
...
...
@@ -584,7 +584,7 @@ class FailingServerTestCase(unittest.TestCase):
p
.
pow
(
6
,
8
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
error
),
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
if
not
is_unavailable_exception
(
e
)
and
hasattr
(
e
,
"headers"
)
:
# We should get error info in the response
expected_err
=
"invalid literal for int() with base 10: 'I am broken'"
self
.
assertEqual
(
e
.
headers
.
get
(
"x-exception"
),
expected_err
)
...
...
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