Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: Lib/test/test_cgitb.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_cgi.py ('k') | Lib/test/test_cmd_line.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_cgitb.py Tue Jul 26 09:37:46 2011 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-from test.support import run_unittest
-import unittest
-import sys
-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")
- except ValueError as err:
- # If the html was templated we could do a bit more here.
- # At least check that we get details on what we just raised.
- html = cgitb.html(sys.exc_info())
- self.assertIn("ValueError", html)
- self.assertIn(str(err), html)
-
- def test_text(self):
- try:
- raise ValueError("Hello World")
- except ValueError as err:
- 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();'
- 'raise ValueError("Hello World")')],
- stdout=subprocess.PIPE)
- out = proc.stdout.read().decode(sys.getfilesystemencoding())
- self.addCleanup(proc.stdout.close)
- self.assertIn("ValueError", out)
- self.assertIn("Hello World", out)
-
-
-def test_main():
- run_unittest(TestCgitb)
-
-if __name__ == "__main__":
- test_main()
« no previous file with comments | « Lib/test/test_cgi.py ('k') | Lib/test/test_cmd_line.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+