diff options
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r-- | Lib/test/test_urllib2.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index d755a61..269451f 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -787,8 +787,8 @@ class HandlerTests(unittest.TestCase): r = MockResponse(200, "OK", {}, "") newreq = h.do_request_(req) if data is None: # GET - self.assertTrue("Content-length" not in req.unredirected_hdrs) - self.assertTrue("Content-type" not in req.unredirected_hdrs) + self.assertNotIn("Content-length", req.unredirected_hdrs) + self.assertNotIn("Content-type", req.unredirected_hdrs) else: # POST self.assertEqual(req.unredirected_hdrs["Content-length"], "0") self.assertEqual(req.unredirected_hdrs["Content-type"], @@ -907,13 +907,13 @@ class HandlerTests(unittest.TestCase): # now it's a GET, there should not be headers regarding content # (possibly dragged from before being a POST) headers = [x.lower() for x in o.req.headers] - self.assertTrue("content-length" not in headers) - self.assertTrue("content-type" not in headers) + self.assertNotIn("content-length", headers) + self.assertNotIn("content-type", headers) self.assertEqual(o.req.headers["Nonsense"], "viking=withhold") - self.assertTrue("Spam" not in o.req.headers) - self.assertTrue("Spam" not in o.req.unredirected_hdrs) + self.assertNotIn("Spam", o.req.headers) + self.assertNotIn("Spam", o.req.unredirected_hdrs) # loop detection req = Request(from_url) |