Normalize whitespace for #11512 fix.

This commit is contained in:
Brian Curtin 2011-07-05 19:16:37 -05:00
parent 6a4ffd7295
commit 692e26be46

View file

@ -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()