mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Normalize whitespace for #11512 fix.
This commit is contained in:
parent
6a4ffd7295
commit
692e26be46
1 changed files with 7 additions and 7 deletions
|
@ -5,19 +5,19 @@ import subprocess
|
|||
import cgitb
|
||||
|
||||
class TestCgitb(unittest.TestCase):
|
||||
|
||||
|
||||
def test_fonts(self):
|
||||
text = "Hello Robbie!"
|
||||
self.assertEqual(cgitb.small(text), "<small>{}</small>".format(text))
|
||||
self.assertEqual(cgitb.strong(text), "<strong>{}</strong>".format(text))
|
||||
self.assertEqual(cgitb.grey(text),
|
||||
'<font color="#909090">{}</font>'.format(text))
|
||||
|
||||
|
||||
def test_blanks(self):
|
||||
self.assertEqual(cgitb.small(""), "")
|
||||
self.assertEqual(cgitb.strong(""), "")
|
||||
self.assertEqual(cgitb.grey(""), "")
|
||||
|
||||
|
||||
def test_html(self):
|
||||
try:
|
||||
raise ValueError("Hello World")
|
||||
|
@ -35,11 +35,11 @@ class TestCgitb(unittest.TestCase):
|
|||
text = cgitb.text(sys.exc_info())
|
||||
self.assertIn("ValueError", text)
|
||||
self.assertIn("Hello World", text)
|
||||
|
||||
|
||||
def test_hook(self):
|
||||
proc = subprocess.Popen([sys.executable, '-c',
|
||||
('import cgitb;'
|
||||
'cgitb.enable();'
|
||||
('import cgitb;'
|
||||
'cgitb.enable();'
|
||||
'raise ValueError("Hello World")')],
|
||||
stdout=subprocess.PIPE)
|
||||
out = proc.stdout.read().decode(sys.getfilesystemencoding())
|
||||
|
@ -50,6 +50,6 @@ class TestCgitb(unittest.TestCase):
|
|||
|
||||
def test_main():
|
||||
run_unittest(TestCgitb)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue