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
9405609c
Kaydet (Commit)
9405609c
authored
Nis 05, 2007
tarafından
Collin Winter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert test_normalization to use unittest.
üst
fe712fb9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
test_normalization.py
Lib/test/test_normalization.py
+21
-15
No files found.
Lib/test/test_normalization.py
Dosyayı görüntüle @
9405609c
from
test.test_support
import
(
verbose
,
TestFailed
,
TestSkipped
,
verify
,
open_urlresource
)
from
test.test_support
import
run_unittest
,
open_urlresource
import
unittest
import
sys
import
os
from
unicodedata
import
normalize
...
...
@@ -29,7 +30,8 @@ def unistr(data):
raise
RangeError
return
u""
.
join
([
unichr
(
x
)
for
x
in
data
])
def
test_main
():
class
NormalizationTest
(
unittest
.
TestCase
):
def
test_main
(
self
):
part1_data
=
{}
for
line
in
open_urlresource
(
TESTDATAURL
):
if
'#'
in
line
:
...
...
@@ -50,24 +52,23 @@ def test_main():
# try atleast adding c1 if we are in part1
if
part
==
"@Part1"
:
try
:
c1
=
unistr
(
line
.
split
(
';'
)[
0
])
c1
=
unistr
(
line
.
split
(
';'
)[
0
])
except
RangeError
:
pass
else
:
part1_data
[
c1
]
=
1
continue
if
verbose
:
print
line
# Perform tests
verify
(
c2
==
NFC
(
c1
)
==
NFC
(
c2
)
==
NFC
(
c3
),
line
)
verify
(
c4
==
NFC
(
c4
)
==
NFC
(
c5
),
line
)
verify
(
c3
==
NFD
(
c1
)
==
NFD
(
c2
)
==
NFD
(
c3
),
line
)
verify
(
c5
==
NFD
(
c4
)
==
NFD
(
c5
),
line
)
verify
(
c4
==
NFKC
(
c1
)
==
NFKC
(
c2
)
==
NFKC
(
c3
)
==
NFKC
(
c4
)
==
NFKC
(
c5
),
self
.
failUnless
(
c2
==
NFC
(
c1
)
==
NFC
(
c2
)
==
NFC
(
c3
),
line
)
self
.
failUnless
(
c4
==
NFC
(
c4
)
==
NFC
(
c5
),
line
)
self
.
failUnless
(
c3
==
NFD
(
c1
)
==
NFD
(
c2
)
==
NFD
(
c3
),
line
)
self
.
failUnless
(
c5
==
NFD
(
c4
)
==
NFD
(
c5
),
line
)
self
.
failUnless
(
c4
==
NFKC
(
c1
)
==
NFKC
(
c2
)
==
\
NFKC
(
c3
)
==
NFKC
(
c4
)
==
NFKC
(
c5
),
line
)
verify
(
c5
==
NFKD
(
c1
)
==
NFKD
(
c2
)
==
NFKD
(
c3
)
==
NFKD
(
c4
)
==
NFKD
(
c5
),
self
.
failUnless
(
c5
==
NFKD
(
c1
)
==
NFKD
(
c2
)
==
\
NFKD
(
c3
)
==
NFKD
(
c4
)
==
NFKD
(
c5
),
line
)
# Record part 1 data
...
...
@@ -79,10 +80,15 @@ def test_main():
X
=
unichr
(
c
)
if
X
in
part1_data
:
continue
assert
X
==
NFC
(
X
)
==
NFD
(
X
)
==
NFKC
(
X
)
==
NFKD
(
X
),
c
self
.
failUnless
(
X
==
NFC
(
X
)
==
NFD
(
X
)
==
NFKC
(
X
)
==
NFKD
(
X
),
c
)
def
test_bug_834676
(
self
):
# Check for bug 834676
normalize
(
'NFC'
,
u'
\ud55c\uae00
'
)
normalize
(
'NFC'
,
u'
\ud55c\uae00
'
)
def
test_main
():
run_unittest
(
NormalizationTest
)
if
__name__
==
"__main__"
:
test_main
()
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