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
66510fed
Kaydet (Commit)
66510fed
authored
Eki 21, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix whacky spacking in test_wsgiref
üst
ae247a5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
57 deletions
+0
-57
test_wsgiref.py
Lib/test/test_wsgiref.py
+0
-57
No files found.
Lib/test/test_wsgiref.py
Dosyayı görüntüle @
66510fed
...
@@ -39,9 +39,6 @@ class MockHandler(WSGIRequestHandler):
...
@@ -39,9 +39,6 @@ class MockHandler(WSGIRequestHandler):
pass
pass
def
hello_app
(
environ
,
start_response
):
def
hello_app
(
environ
,
start_response
):
start_response
(
"200 OK"
,
[
start_response
(
"200 OK"
,
[
(
'Content-Type'
,
'text/plain'
),
(
'Content-Type'
,
'text/plain'
),
...
@@ -63,28 +60,6 @@ def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"):
...
@@ -63,28 +60,6 @@ def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"):
return
out
.
getvalue
(),
err
.
getvalue
()
return
out
.
getvalue
(),
err
.
getvalue
()
def
compare_generic_iter
(
make_it
,
match
):
def
compare_generic_iter
(
make_it
,
match
):
"""Utility to compare a generic 2.1/2.2+ iterator with an iterable
"""Utility to compare a generic 2.1/2.2+ iterator with an iterable
...
@@ -122,10 +97,6 @@ def compare_generic_iter(make_it,match):
...
@@ -122,10 +97,6 @@ def compare_generic_iter(make_it,match):
raise
AssertionError
(
"Too many items from .__next__()"
,
it
)
raise
AssertionError
(
"Too many items from .__next__()"
,
it
)
class
IntegrationTests
(
TestCase
):
class
IntegrationTests
(
TestCase
):
def
check_hello
(
self
,
out
,
has_length
=
True
):
def
check_hello
(
self
,
out
,
has_length
=
True
):
...
@@ -195,8 +166,6 @@ class IntegrationTests(TestCase):
...
@@ -195,8 +166,6 @@ class IntegrationTests(TestCase):
out
)
out
)
class
UtilityTests
(
TestCase
):
class
UtilityTests
(
TestCase
):
def
checkShift
(
self
,
sn_in
,
pi_in
,
part
,
sn_out
,
pi_out
):
def
checkShift
(
self
,
sn_in
,
pi_in
,
part
,
sn_out
,
pi_out
):
...
@@ -235,11 +204,6 @@ class UtilityTests(TestCase):
...
@@ -235,11 +204,6 @@ class UtilityTests(TestCase):
util
.
setup_testing_defaults
(
kw
)
util
.
setup_testing_defaults
(
kw
)
self
.
assertEqual
(
util
.
request_uri
(
kw
,
query
),
uri
)
self
.
assertEqual
(
util
.
request_uri
(
kw
,
query
),
uri
)
def
checkFW
(
self
,
text
,
size
,
match
):
def
checkFW
(
self
,
text
,
size
,
match
):
def
make_it
(
text
=
text
,
size
=
size
):
def
make_it
(
text
=
text
,
size
=
size
):
...
@@ -258,7 +222,6 @@ class UtilityTests(TestCase):
...
@@ -258,7 +222,6 @@ class UtilityTests(TestCase):
it
.
close
()
it
.
close
()
self
.
assertTrue
(
it
.
filelike
.
closed
)
self
.
assertTrue
(
it
.
filelike
.
closed
)
def
testSimpleShifts
(
self
):
def
testSimpleShifts
(
self
):
self
.
checkShift
(
''
,
'/'
,
''
,
'/'
,
''
)
self
.
checkShift
(
''
,
'/'
,
''
,
'/'
,
''
)
self
.
checkShift
(
''
,
'/x'
,
'x'
,
'/x'
,
''
)
self
.
checkShift
(
''
,
'/x'
,
'x'
,
'/x'
,
''
)
...
@@ -266,7 +229,6 @@ class UtilityTests(TestCase):
...
@@ -266,7 +229,6 @@ class UtilityTests(TestCase):
self
.
checkShift
(
'/a'
,
'/x/y'
,
'x'
,
'/a/x'
,
'/y'
)
self
.
checkShift
(
'/a'
,
'/x/y'
,
'x'
,
'/a/x'
,
'/y'
)
self
.
checkShift
(
'/a'
,
'/x/'
,
'x'
,
'/a/x'
,
'/'
)
self
.
checkShift
(
'/a'
,
'/x/'
,
'x'
,
'/a/x'
,
'/'
)
def
testNormalizedShifts
(
self
):
def
testNormalizedShifts
(
self
):
self
.
checkShift
(
'/a/b'
,
'/../y'
,
'..'
,
'/a'
,
'/y'
)
self
.
checkShift
(
'/a/b'
,
'/../y'
,
'..'
,
'/a'
,
'/y'
)
self
.
checkShift
(
''
,
'/../y'
,
'..'
,
''
,
'/y'
)
self
.
checkShift
(
''
,
'/../y'
,
'..'
,
''
,
'/y'
)
...
@@ -280,7 +242,6 @@ class UtilityTests(TestCase):
...
@@ -280,7 +242,6 @@ class UtilityTests(TestCase):
self
.
checkShift
(
'/a/b'
,
'/x//'
,
'x'
,
'/a/b/x'
,
'/'
)
self
.
checkShift
(
'/a/b'
,
'/x//'
,
'x'
,
'/a/b/x'
,
'/'
)
self
.
checkShift
(
'/a/b'
,
'/.'
,
None
,
'/a/b'
,
''
)
self
.
checkShift
(
'/a/b'
,
'/.'
,
None
,
'/a/b'
,
''
)
def
testDefaults
(
self
):
def
testDefaults
(
self
):
for
key
,
value
in
[
for
key
,
value
in
[
(
'SERVER_NAME'
,
'127.0.0.1'
),
(
'SERVER_NAME'
,
'127.0.0.1'
),
...
@@ -300,7 +261,6 @@ class UtilityTests(TestCase):
...
@@ -300,7 +261,6 @@ class UtilityTests(TestCase):
]:
]:
self
.
checkDefault
(
key
,
value
)
self
.
checkDefault
(
key
,
value
)
def
testCrossDefaults
(
self
):
def
testCrossDefaults
(
self
):
self
.
checkCrossDefault
(
'HTTP_HOST'
,
"foo.bar"
,
SERVER_NAME
=
"foo.bar"
)
self
.
checkCrossDefault
(
'HTTP_HOST'
,
"foo.bar"
,
SERVER_NAME
=
"foo.bar"
)
self
.
checkCrossDefault
(
'wsgi.url_scheme'
,
"https"
,
HTTPS
=
"on"
)
self
.
checkCrossDefault
(
'wsgi.url_scheme'
,
"https"
,
HTTPS
=
"on"
)
...
@@ -310,7 +270,6 @@ class UtilityTests(TestCase):
...
@@ -310,7 +270,6 @@ class UtilityTests(TestCase):
self
.
checkCrossDefault
(
'SERVER_PORT'
,
"80"
,
HTTPS
=
"foo"
)
self
.
checkCrossDefault
(
'SERVER_PORT'
,
"80"
,
HTTPS
=
"foo"
)
self
.
checkCrossDefault
(
'SERVER_PORT'
,
"443"
,
HTTPS
=
"on"
)
self
.
checkCrossDefault
(
'SERVER_PORT'
,
"443"
,
HTTPS
=
"on"
)
def
testGuessScheme
(
self
):
def
testGuessScheme
(
self
):
self
.
assertEqual
(
util
.
guess_scheme
({}),
"http"
)
self
.
assertEqual
(
util
.
guess_scheme
({}),
"http"
)
self
.
assertEqual
(
util
.
guess_scheme
({
'HTTPS'
:
"foo"
}),
"http"
)
self
.
assertEqual
(
util
.
guess_scheme
({
'HTTPS'
:
"foo"
}),
"http"
)
...
@@ -318,10 +277,6 @@ class UtilityTests(TestCase):
...
@@ -318,10 +277,6 @@ class UtilityTests(TestCase):
self
.
assertEqual
(
util
.
guess_scheme
({
'HTTPS'
:
"yes"
}),
"https"
)
self
.
assertEqual
(
util
.
guess_scheme
({
'HTTPS'
:
"yes"
}),
"https"
)
self
.
assertEqual
(
util
.
guess_scheme
({
'HTTPS'
:
"1"
}),
"https"
)
self
.
assertEqual
(
util
.
guess_scheme
({
'HTTPS'
:
"1"
}),
"https"
)
def
testAppURIs
(
self
):
def
testAppURIs
(
self
):
self
.
checkAppURI
(
"http://127.0.0.1/"
)
self
.
checkAppURI
(
"http://127.0.0.1/"
)
self
.
checkAppURI
(
"http://127.0.0.1/spam"
,
SCRIPT_NAME
=
"/spam"
)
self
.
checkAppURI
(
"http://127.0.0.1/spam"
,
SCRIPT_NAME
=
"/spam"
)
...
@@ -446,15 +401,6 @@ class TestHandler(ErrorHandler):
...
@@ -446,15 +401,6 @@ class TestHandler(ErrorHandler):
raise
# for testing, we want to see what's happening
raise
# for testing, we want to see what's happening
class
HandlerTests
(
TestCase
):
class
HandlerTests
(
TestCase
):
def
checkEnvironAttrs
(
self
,
handler
):
def
checkEnvironAttrs
(
self
,
handler
):
...
@@ -495,7 +441,6 @@ class HandlerTests(TestCase):
...
@@ -495,7 +441,6 @@ class HandlerTests(TestCase):
h
=
TestHandler
();
h
.
setup_environ
()
h
=
TestHandler
();
h
.
setup_environ
()
self
.
assertEqual
(
h
.
environ
[
'wsgi.url_scheme'
],
'http'
)
self
.
assertEqual
(
h
.
environ
[
'wsgi.url_scheme'
],
'http'
)
def
testAbstractMethods
(
self
):
def
testAbstractMethods
(
self
):
h
=
BaseHandler
()
h
=
BaseHandler
()
for
name
in
[
for
name
in
[
...
@@ -504,7 +449,6 @@ class HandlerTests(TestCase):
...
@@ -504,7 +449,6 @@ class HandlerTests(TestCase):
self
.
assertRaises
(
NotImplementedError
,
getattr
(
h
,
name
))
self
.
assertRaises
(
NotImplementedError
,
getattr
(
h
,
name
))
self
.
assertRaises
(
NotImplementedError
,
h
.
_write
,
"test"
)
self
.
assertRaises
(
NotImplementedError
,
h
.
_write
,
"test"
)
def
testContentLength
(
self
):
def
testContentLength
(
self
):
# Demo one reason iteration is better than write()... ;)
# Demo one reason iteration is better than write()... ;)
...
@@ -596,7 +540,6 @@ class HandlerTests(TestCase):
...
@@ -596,7 +540,6 @@ class HandlerTests(TestCase):
"
\r\n
"
.
encode
(
"iso-8859-1"
)
+
MSG
))
"
\r\n
"
.
encode
(
"iso-8859-1"
)
+
MSG
))
self
.
assertIn
(
"AssertionError"
,
h
.
stderr
.
getvalue
())
self
.
assertIn
(
"AssertionError"
,
h
.
stderr
.
getvalue
())
def
testHeaderFormats
(
self
):
def
testHeaderFormats
(
self
):
def
non_error_app
(
e
,
s
):
def
non_error_app
(
e
,
s
):
...
...
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