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
ee354eab
Kaydet (Commit)
ee354eab
authored
Mar 14, 2011
tarafından
Michael Foord
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge default
üst
1341bb00
5596a8c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
0 deletions
+40
-0
test_pep292.py
Lib/test/test_pep292.py
+13
-0
test_string.py
Lib/test/test_string.py
+24
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_pep292.py
Dosyayı görüntüle @
ee354eab
...
@@ -42,6 +42,19 @@ class TestTemplate(unittest.TestCase):
...
@@ -42,6 +42,19 @@ class TestTemplate(unittest.TestCase):
s
=
Template
(
'$who likes $$'
)
s
=
Template
(
'$who likes $$'
)
eq
(
s
.
substitute
(
dict
(
who
=
'tim'
,
what
=
'ham'
)),
'tim likes $'
)
eq
(
s
.
substitute
(
dict
(
who
=
'tim'
,
what
=
'ham'
)),
'tim likes $'
)
def
test_invalid
(
self
):
class
MyPattern
(
Template
):
pattern
=
r"""
(?:
(?P<invalid>) |
(?P<escaped>
%(delim)
s) |
@(?P<named>
%(id)
s) |
@{(?P<braced>
%(id)
s)}
)
"""
s
=
MyPattern
(
'$'
)
self
.
assertRaises
(
ValueError
,
s
.
substitute
,
dict
())
def
test_percents
(
self
):
def
test_percents
(
self
):
eq
=
self
.
assertEqual
eq
=
self
.
assertEqual
s
=
Template
(
'
%(foo)
s $foo ${foo}'
)
s
=
Template
(
'
%(foo)
s $foo ${foo}'
)
...
...
Lib/test/test_string.py
Dosyayı görüntüle @
ee354eab
...
@@ -112,6 +112,30 @@ class ModuleTest(unittest.TestCase):
...
@@ -112,6 +112,30 @@ class ModuleTest(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
fmt
.
format
,
"{0}"
,
10
,
20
,
i
=
100
)
self
.
assertRaises
(
ValueError
,
fmt
.
format
,
"{0}"
,
10
,
20
,
i
=
100
)
self
.
assertRaises
(
ValueError
,
fmt
.
format
,
"{i}"
,
10
,
20
,
i
=
100
)
self
.
assertRaises
(
ValueError
,
fmt
.
format
,
"{i}"
,
10
,
20
,
i
=
100
)
def
test_vformat_assert
(
self
):
cls
=
string
.
Formatter
()
kwargs
=
{
"i"
:
100
}
self
.
assertRaises
(
ValueError
,
cls
.
_vformat
,
cls
.
format
,
"{0}"
,
kwargs
,
set
(),
-
2
)
def
test_convert_field
(
self
):
cls
=
string
.
Formatter
()
self
.
assertEqual
(
cls
.
format
(
"{0!s}"
,
'foo'
),
'foo'
)
self
.
assertRaises
(
ValueError
,
cls
.
format
,
"{0!h}"
,
'foo'
)
def
test_get_field
(
self
):
cls
=
string
.
Formatter
()
class
MyClass
:
name
=
'lumberjack'
x
=
MyClass
()
self
.
assertEqual
(
cls
.
format
(
"{0.name}"
,
x
),
'lumberjack'
)
lookup
=
[
"eggs"
,
"and"
,
"spam"
]
self
.
assertEqual
(
cls
.
format
(
"{0[2]}"
,
lookup
),
'spam'
)
def
test_main
():
def
test_main
():
support
.
run_unittest
(
ModuleTest
)
support
.
run_unittest
(
ModuleTest
)
...
...
Misc/ACKS
Dosyayı görüntüle @
ee354eab
...
@@ -32,6 +32,7 @@ Oliver Andrich
...
@@ -32,6 +32,7 @@ Oliver Andrich
Ross Andrus
Ross Andrus
Jon Anglin
Jon Anglin
Éric Araujo
Éric Araujo
Alicia Arlen
Jason Asbahr
Jason Asbahr
David Ascher
David Ascher
Chris AtLee
Chris AtLee
...
...
Misc/NEWS
Dosyayı görüntüle @
ee354eab
...
@@ -203,6 +203,8 @@ Tools/Demos
...
@@ -203,6 +203,8 @@ Tools/Demos
Tests
Tests
-----
-----
-
Issue
#
11505
:
improves
test
coverage
of
string
.
py
-
Issue
#
11490
:
test_subprocess
:
test_leaking_fds_on_error
no
longer
gives
a
-
Issue
#
11490
:
test_subprocess
:
test_leaking_fds_on_error
no
longer
gives
a
false
positive
if
the
last
directory
in
the
path
is
inaccessible
.
false
positive
if
the
last
directory
in
the
path
is
inaccessible
.
...
...
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