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
692e26be
Kaydet (Commit)
692e26be
authored
Tem 06, 2011
tarafından
Brian Curtin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Normalize whitespace for #11512 fix.
üst
6a4ffd72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
test_cgitb.py
Lib/test/test_cgitb.py
+7
-7
No files found.
Lib/test/test_cgitb.py
Dosyayı görüntüle @
692e26be
...
@@ -5,19 +5,19 @@ import subprocess
...
@@ -5,19 +5,19 @@ import subprocess
import
cgitb
import
cgitb
class
TestCgitb
(
unittest
.
TestCase
):
class
TestCgitb
(
unittest
.
TestCase
):
def
test_fonts
(
self
):
def
test_fonts
(
self
):
text
=
"Hello Robbie!"
text
=
"Hello Robbie!"
self
.
assertEqual
(
cgitb
.
small
(
text
),
"<small>{}</small>"
.
format
(
text
))
self
.
assertEqual
(
cgitb
.
small
(
text
),
"<small>{}</small>"
.
format
(
text
))
self
.
assertEqual
(
cgitb
.
strong
(
text
),
"<strong>{}</strong>"
.
format
(
text
))
self
.
assertEqual
(
cgitb
.
strong
(
text
),
"<strong>{}</strong>"
.
format
(
text
))
self
.
assertEqual
(
cgitb
.
grey
(
text
),
self
.
assertEqual
(
cgitb
.
grey
(
text
),
'<font color="#909090">{}</font>'
.
format
(
text
))
'<font color="#909090">{}</font>'
.
format
(
text
))
def
test_blanks
(
self
):
def
test_blanks
(
self
):
self
.
assertEqual
(
cgitb
.
small
(
""
),
""
)
self
.
assertEqual
(
cgitb
.
small
(
""
),
""
)
self
.
assertEqual
(
cgitb
.
strong
(
""
),
""
)
self
.
assertEqual
(
cgitb
.
strong
(
""
),
""
)
self
.
assertEqual
(
cgitb
.
grey
(
""
),
""
)
self
.
assertEqual
(
cgitb
.
grey
(
""
),
""
)
def
test_html
(
self
):
def
test_html
(
self
):
try
:
try
:
raise
ValueError
(
"Hello World"
)
raise
ValueError
(
"Hello World"
)
...
@@ -35,11 +35,11 @@ class TestCgitb(unittest.TestCase):
...
@@ -35,11 +35,11 @@ class TestCgitb(unittest.TestCase):
text
=
cgitb
.
text
(
sys
.
exc_info
())
text
=
cgitb
.
text
(
sys
.
exc_info
())
self
.
assertIn
(
"ValueError"
,
text
)
self
.
assertIn
(
"ValueError"
,
text
)
self
.
assertIn
(
"Hello World"
,
text
)
self
.
assertIn
(
"Hello World"
,
text
)
def
test_hook
(
self
):
def
test_hook
(
self
):
proc
=
subprocess
.
Popen
([
sys
.
executable
,
'-c'
,
proc
=
subprocess
.
Popen
([
sys
.
executable
,
'-c'
,
(
'import cgitb;'
(
'import cgitb;'
'cgitb.enable();'
'cgitb.enable();'
'raise ValueError("Hello World")'
)],
'raise ValueError("Hello World")'
)],
stdout
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
)
out
=
proc
.
stdout
.
read
()
.
decode
(
sys
.
getfilesystemencoding
())
out
=
proc
.
stdout
.
read
()
.
decode
(
sys
.
getfilesystemencoding
())
...
@@ -50,6 +50,6 @@ class TestCgitb(unittest.TestCase):
...
@@ -50,6 +50,6 @@ class TestCgitb(unittest.TestCase):
def
test_main
():
def
test_main
():
run_unittest
(
TestCgitb
)
run_unittest
(
TestCgitb
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_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