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
ef490964
Kaydet (Commit)
ef490964
authored
Ock 31, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7092: silence more -3 and -Wd warnings
üst
46bff79d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
33 deletions
+41
-33
cgi.py
Lib/cgi.py
+1
-1
test_cgi.py
Lib/test/test_cgi.py
+20
-23
test_coercion.py
Lib/test/test_coercion.py
+10
-7
test_distutils.py
Lib/test/test_distutils.py
+6
-1
test_userstring.py
Lib/test/test_userstring.py
+4
-1
No files found.
Lib/cgi.py
Dosyayı görüntüle @
ef490964
...
...
@@ -172,7 +172,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
else
:
qs
=
""
environ
[
'QUERY_STRING'
]
=
qs
# XXX Shouldn't, really
return
parse_qs
(
qs
,
keep_blank_values
,
strict_parsing
)
return
urlparse
.
parse_qs
(
qs
,
keep_blank_values
,
strict_parsing
)
# parse query string function called from urlparse,
...
...
Lib/test/test_cgi.py
Dosyayı görüntüle @
ef490964
from
test.test_support
import
run_unittest
from
test.test_support
import
run_unittest
,
check_warnings
import
cgi
import
os
import
sys
...
...
@@ -102,11 +102,6 @@ parse_strict_test_cases = [
})
]
def
norm
(
list
):
if
type
(
list
)
==
type
([]):
list
.
sort
()
return
list
def
first_elts
(
list
):
return
map
(
lambda
x
:
x
[
0
],
list
)
...
...
@@ -141,18 +136,18 @@ class CgiTests(unittest.TestCase):
if
type
(
expect
)
==
type
({}):
# test dict interface
self
.
assertEqual
(
len
(
expect
),
len
(
fcd
))
self
.
assert
Equal
(
norm
(
expect
.
keys
()),
norm
(
fcd
.
keys
()
))
self
.
assert
Equal
(
norm
(
expect
.
values
()),
norm
(
fcd
.
values
()
))
self
.
assert
Equal
(
norm
(
expect
.
items
()),
norm
(
fcd
.
items
()
))
self
.
assert
SameElements
(
expect
.
keys
(),
fcd
.
keys
(
))
self
.
assert
SameElements
(
expect
.
values
(),
fcd
.
values
(
))
self
.
assert
SameElements
(
expect
.
items
(),
fcd
.
items
(
))
self
.
assertEqual
(
fcd
.
get
(
"nonexistent field"
,
"default"
),
"default"
)
self
.
assertEqual
(
len
(
sd
),
len
(
fs
))
self
.
assert
Equal
(
norm
(
sd
.
keys
()),
norm
(
fs
.
keys
()
))
self
.
assert
SameElements
(
sd
.
keys
(),
fs
.
keys
(
))
self
.
assertEqual
(
fs
.
getvalue
(
"nonexistent field"
,
"default"
),
"default"
)
# test individual fields
for
key
in
expect
.
keys
():
expect_val
=
expect
[
key
]
self
.
assertTrue
(
fcd
.
has_key
(
key
))
self
.
assert
Equal
(
norm
(
fcd
[
key
]),
norm
(
expect
[
key
])
)
self
.
assert
SameElements
(
fcd
[
key
],
expect
[
key
]
)
self
.
assertEqual
(
fcd
.
get
(
key
,
"default"
),
fcd
[
key
])
self
.
assertTrue
(
fs
.
has_key
(
key
))
if
len
(
expect_val
)
>
1
:
...
...
@@ -168,12 +163,12 @@ class CgiTests(unittest.TestCase):
self
.
assertTrue
(
single_value
)
self
.
assertEqual
(
val
,
expect_val
[
0
])
self
.
assertEqual
(
fs
.
getvalue
(
key
),
expect_val
[
0
])
self
.
assert
Equal
(
norm
(
sd
.
getlist
(
key
)),
norm
(
expect_val
)
)
self
.
assert
SameElements
(
sd
.
getlist
(
key
),
expect_val
)
if
single_value
:
self
.
assert
Equal
(
norm
(
sd
.
values
()
),
first_elts
(
norm
(
expect
.
values
()
)))
self
.
assert
Equal
(
norm
(
sd
.
items
()
),
first_second_elts
(
norm
(
expect
.
items
()
)))
self
.
assert
SameElements
(
sd
.
values
(
),
first_elts
(
expect
.
values
(
)))
self
.
assert
SameElements
(
sd
.
items
(
),
first_second_elts
(
expect
.
items
(
)))
def
test_weird_formcontentdict
(
self
):
# Test the weird FormContentDict classes
...
...
@@ -184,7 +179,7 @@ class CgiTests(unittest.TestCase):
self
.
assertEqual
(
d
[
k
],
v
)
for
k
,
v
in
d
.
items
():
self
.
assertEqual
(
expect
[
k
],
v
)
self
.
assert
Equal
(
norm
(
expect
.
values
()),
norm
(
d
.
values
()
))
self
.
assert
SameElements
(
expect
.
values
(),
d
.
values
(
))
def
test_log
(
self
):
cgi
.
log
(
"Testing"
)
...
...
@@ -345,14 +340,16 @@ this is the content of the fake file
self
.
assertEqual
(
result
,
v
)
def
test_deprecated_parse_qs
(
self
):
# this func is moved to urlparse, this is just a sanity check
self
.
assertEqual
({
'a'
:
[
'A1'
],
'B'
:
[
'B3'
],
'b'
:
[
'B2'
]},
cgi
.
parse_qs
(
'a=A1&b=B2&B=B3'
))
with
check_warnings
():
# this func is moved to urlparse, this is just a sanity check
self
.
assertEqual
({
'a'
:
[
'A1'
],
'B'
:
[
'B3'
],
'b'
:
[
'B2'
]},
cgi
.
parse_qs
(
'a=A1&b=B2&B=B3'
))
def
test_deprecated_parse_qsl
(
self
):
# this func is moved to urlparse, this is just a sanity check
self
.
assertEqual
([(
'a'
,
'A1'
),
(
'b'
,
'B2'
),
(
'B'
,
'B3'
)],
cgi
.
parse_qsl
(
'a=A1&b=B2&B=B3'
))
with
check_warnings
():
# this func is moved to urlparse, this is just a sanity check
self
.
assertEqual
([(
'a'
,
'A1'
),
(
'b'
,
'B2'
),
(
'B'
,
'B3'
)],
cgi
.
parse_qsl
(
'a=A1&b=B2&B=B3'
))
def
test_parse_header
(
self
):
self
.
assertEqual
(
...
...
Lib/test/test_coercion.py
Dosyayı görüntüle @
ef490964
...
...
@@ -223,8 +223,10 @@ def process_infix_results():
infix_results
[
key
]
=
res
process_infix_results
()
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
"ignore"
,
"classic int division"
,
DeprecationWarning
)
process_infix_results
()
# now infix_results has two lists of results for every pairing.
prefix_binops
=
[
'divmod'
]
...
...
@@ -337,11 +339,12 @@ class CoercionTest(unittest.TestCase):
raise
exc
def
test_main
():
warnings
.
filterwarnings
(
"ignore"
,
r'complex divmod\(\), // and
%
are deprecated'
,
DeprecationWarning
,
r'test.test_coercion$'
)
run_unittest
(
CoercionTest
)
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
"ignore"
,
"complex divmod.., // and
%
"
"are deprecated"
,
DeprecationWarning
)
warnings
.
filterwarnings
(
"ignore"
,
"classic (int|long) division"
,
DeprecationWarning
)
run_unittest
(
CoercionTest
)
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_distutils.py
Dosyayı görüntüle @
ef490964
...
...
@@ -7,10 +7,15 @@ be run.
import
distutils.tests
import
test.test_support
import
warnings
def
test_main
():
test
.
test_support
.
run_unittest
(
distutils
.
tests
.
test_suite
())
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
"ignore"
,
"distutils.sysconfig.
\
w+ is deprecated"
,
DeprecationWarning
)
test
.
test_support
.
run_unittest
(
distutils
.
tests
.
test_suite
())
test
.
test_support
.
reap_children
()
...
...
Lib/test/test_userstring.py
Dosyayı görüntüle @
ef490964
...
...
@@ -136,7 +136,10 @@ class MutableStringTest(UserStringTest):
def
test_main
():
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
"ignore"
,
".*MutableString"
,
warnings
.
filterwarnings
(
"ignore"
,
".*MutableString has been removed"
,
DeprecationWarning
)
warnings
.
filterwarnings
(
"ignore"
,
".*__(get|set|del)slice__ has been removed"
,
DeprecationWarning
)
test_support
.
run_unittest
(
UserStringTest
,
MutableStringTest
)
...
...
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