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
2a83f16e
Kaydet (Commit)
2a83f16e
authored
Eki 28, 2012
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #14700: merge tests from 3.2.
üst
5b9561d1
fb90c093
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
test_unicode.py
Lib/test/test_unicode.py
+27
-0
No files found.
Lib/test/test_unicode.py
Dosyayı görüntüle @
2a83f16e
...
@@ -981,6 +981,21 @@ class UnicodeTest(string_tests.CommonTest,
...
@@ -981,6 +981,21 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertRaises
(
ValueError
,
'{}'
.
format_map
,
'a'
)
self
.
assertRaises
(
ValueError
,
'{}'
.
format_map
,
'a'
)
self
.
assertRaises
(
ValueError
,
'{a} {}'
.
format_map
,
{
"a"
:
2
,
"b"
:
1
})
self
.
assertRaises
(
ValueError
,
'{a} {}'
.
format_map
,
{
"a"
:
2
,
"b"
:
1
})
def
test_format_huge_precision
(
self
):
format_string
=
".{}f"
.
format
(
sys
.
maxsize
+
1
)
with
self
.
assertRaises
(
ValueError
):
result
=
format
(
2.34
,
format_string
)
def
test_format_huge_width
(
self
):
format_string
=
"{}f"
.
format
(
sys
.
maxsize
+
1
)
with
self
.
assertRaises
(
ValueError
):
result
=
format
(
2.34
,
format_string
)
def
test_format_huge_item_number
(
self
):
format_string
=
"{{{}:.6f}}"
.
format
(
sys
.
maxsize
+
1
)
with
self
.
assertRaises
(
ValueError
):
result
=
format_string
.
format
(
2.34
)
def
test_format_auto_numbering
(
self
):
def
test_format_auto_numbering
(
self
):
class
C
:
class
C
:
def
__init__
(
self
,
x
=
100
):
def
__init__
(
self
,
x
=
100
):
...
@@ -1069,6 +1084,18 @@ class UnicodeTest(string_tests.CommonTest,
...
@@ -1069,6 +1084,18 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertEqual
(
'
%.1
s'
%
"a
\xe9\u20ac
"
,
'a'
)
self
.
assertEqual
(
'
%.1
s'
%
"a
\xe9\u20ac
"
,
'a'
)
self
.
assertEqual
(
'
%.2
s'
%
"a
\xe9\u20ac
"
,
'a
\xe9
'
)
self
.
assertEqual
(
'
%.2
s'
%
"a
\xe9\u20ac
"
,
'a
\xe9
'
)
@support.cpython_only
def
test_formatting_huge_precision
(
self
):
from
_testcapi
import
INT_MAX
format_string
=
"
%
.{}f"
.
format
(
INT_MAX
+
1
)
with
self
.
assertRaises
(
ValueError
):
result
=
format_string
%
2.34
def
test_formatting_huge_width
(
self
):
format_string
=
"
%
{}f"
.
format
(
sys
.
maxsize
+
1
)
with
self
.
assertRaises
(
ValueError
):
result
=
format_string
%
2.34
def
test_startswith_endswith_errors
(
self
):
def
test_startswith_endswith_errors
(
self
):
for
meth
in
(
'foo'
.
startswith
,
'foo'
.
endswith
):
for
meth
in
(
'foo'
.
startswith
,
'foo'
.
endswith
):
with
self
.
assertRaises
(
TypeError
)
as
cm
:
with
self
.
assertRaises
(
TypeError
)
as
cm
:
...
...
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