mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
use assert[Not]In where appropriate
A patch from Dave Malcolm.
This commit is contained in:
parent
a69ba65fdc
commit
577473fe68
75 changed files with 471 additions and 454 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue