diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-01-19 00:09:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-01-19 00:09:57 (GMT) |
commit | 577473fe687b38c8f01b0c372d6d2563680045b3 (patch) | |
tree | ee7dc210c7c5281cf07add09a9cb451758e91716 /Lib/test/test_wsgiref.py | |
parent | a69ba65fdce3be6f55634b47cc56cf1f962f6cbc (diff) | |
download | cpython-577473fe687b38c8f01b0c372d6d2563680045b3.zip cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.gz cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.bz2 |
use assert[Not]In where appropriate
A patch from Dave Malcolm.
Diffstat (limited to 'Lib/test/test_wsgiref.py')
-rwxr-xr-x | Lib/test/test_wsgiref.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index 0b1a637..ab6096a 100755 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -440,7 +440,7 @@ class HeaderTests(TestCase): h.get("content-disposition")) del h['content-disposition'] - self.assertTrue(b'content-disposition' not in h) + self.assertNotIn(b'content-disposition', h) class ErrorHandler(BaseCGIHandler): @@ -493,7 +493,7 @@ class HandlerTests(TestCase): if k not in empty: self.assertEqual(env[k],v) for k,v in empty.items(): - self.assertTrue(k in env) + self.assertIn(k, env) def testEnviron(self): h = TestHandler(X="Y") @@ -506,7 +506,7 @@ class HandlerTests(TestCase): h = BaseCGIHandler(None,None,None,{}) h.setup_environ() for key in 'wsgi.url_scheme', 'wsgi.input', 'wsgi.errors': - self.assertTrue(key in h.environ) + self.assertIn(key, h.environ) def testScheme(self): h=TestHandler(HTTPS="on"); h.setup_environ() @@ -593,7 +593,7 @@ class HandlerTests(TestCase): "\r\n%s" % (h.error_status,len(h.error_body),h.error_body) ).encode("iso-8859-1")) - self.assertTrue("AssertionError" in h.stderr.getvalue()) + self.assertIn("AssertionError", h.stderr.getvalue()) def testErrorAfterOutput(self): MSG = "Some output has been sent" @@ -606,7 +606,7 @@ class HandlerTests(TestCase): self.assertEqual(h.stdout.getvalue(), ("Status: 200 OK\r\n" "\r\n"+MSG).encode("iso-8859-1")) - self.assertTrue("AssertionError" in h.stderr.getvalue()) + self.assertIn("AssertionError", h.stderr.getvalue()) def testHeaderFormats(self): |