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
1ef7c6bc
Kaydet (Commit)
1ef7c6bc
authored
Mar 26, 2009
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a few more tests for urllib.parse.urlencode.
Fix some long lines.
üst
230feba5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
test_urllib.py
Lib/test/test_urllib.py
+19
-2
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
1ef7c6bc
...
...
@@ -379,7 +379,8 @@ class QuotingTests(unittest.TestCase):
result
=
urllib
.
parse
.
quote
(
quote_by_default
,
safe
=
quote_by_default
)
self
.
assertEqual
(
quote_by_default
,
result
,
"using quote():
%
r !=
%
r"
%
(
quote_by_default
,
result
))
result
=
urllib
.
parse
.
quote_plus
(
quote_by_default
,
safe
=
quote_by_default
)
result
=
urllib
.
parse
.
quote_plus
(
quote_by_default
,
safe
=
quote_by_default
)
self
.
assertEqual
(
quote_by_default
,
result
,
"using quote_plus():
%
r !=
%
r"
%
(
quote_by_default
,
result
))
...
...
@@ -411,7 +412,8 @@ class QuotingTests(unittest.TestCase):
for
char
in
should_quote
:
result
=
urllib
.
parse
.
quote
(
char
)
self
.
assertEqual
(
hexescape
(
char
),
result
,
"using quote():
%
s should be escaped to
%
s, not
%
s"
%
"using quote(): "
"
%
s should be escaped to
%
s, not
%
s"
%
(
char
,
hexescape
(
char
),
result
))
result
=
urllib
.
parse
.
quote_plus
(
char
)
self
.
assertEqual
(
hexescape
(
char
),
result
,
...
...
@@ -770,6 +772,21 @@ class urlencode_Tests(unittest.TestCase):
self
.
assertEqual
(
result
.
count
(
'&'
),
2
,
"Expected 2 '&'s, got
%
s"
%
result
.
count
(
'&'
))
def
test_empty_sequence
(
self
):
self
.
assertEqual
(
""
,
urllib
.
parse
.
urlencode
({}))
self
.
assertEqual
(
""
,
urllib
.
parse
.
urlencode
([]))
def
test_nonstring_values
(
self
):
self
.
assertEqual
(
"a=1"
,
urllib
.
parse
.
urlencode
({
"a"
:
1
}))
self
.
assertEqual
(
"a=None"
,
urllib
.
parse
.
urlencode
({
"a"
:
None
}))
def
test_nonstring_seq_values
(
self
):
self
.
assertEqual
(
"a=1&a=2"
,
urllib
.
parse
.
urlencode
({
"a"
:
[
1
,
2
]},
True
))
self
.
assertEqual
(
"a=None&a=a"
,
urllib
.
parse
.
urlencode
({
"a"
:
[
None
,
"a"
]},
True
))
self
.
assertEqual
(
"a=a&a=b"
,
urllib
.
parse
.
urlencode
({
"a"
:
{
"a"
:
1
,
"b"
:
1
}},
True
))
class
Pathname_Tests
(
unittest
.
TestCase
):
"""Test pathname2url() and url2pathname()"""
...
...
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