Issue 10825: Minor updates to the test suite.
This commit is contained in:
parent
90a4b3162e
commit
7beae8a0d5
|
@ -202,7 +202,7 @@ class TestTimeZone(unittest.TestCase):
|
|||
|
||||
|
||||
def test_dst(self):
|
||||
self.assertEqual(None, timezone.utc.dst(self.DT))
|
||||
self.assertIsNone(timezone.utc.dst(self.DT))
|
||||
|
||||
with self.assertRaises(TypeError): self.EST.dst('')
|
||||
with self.assertRaises(TypeError): self.EST.dst(5)
|
||||
|
|
|
@ -560,7 +560,7 @@ class RequestBodyTest(TestCase):
|
|||
self.conn.request("PUT", "/url", "body")
|
||||
message, f = self.get_headers_and_fp()
|
||||
self.assertEqual("text/plain", message.get_content_type())
|
||||
self.assertEqual(None, message.get_charset())
|
||||
self.assertIsNone(message.get_charset())
|
||||
self.assertEqual("4", message.get("content-length"))
|
||||
self.assertEqual(b'body', f.read())
|
||||
|
||||
|
@ -568,7 +568,7 @@ class RequestBodyTest(TestCase):
|
|||
self.conn.request("PUT", "/url", "body\xc1")
|
||||
message, f = self.get_headers_and_fp()
|
||||
self.assertEqual("text/plain", message.get_content_type())
|
||||
self.assertEqual(None, message.get_charset())
|
||||
self.assertIsNone(message.get_charset())
|
||||
self.assertEqual("5", message.get("content-length"))
|
||||
self.assertEqual(b'body\xc1', f.read())
|
||||
|
||||
|
@ -576,7 +576,7 @@ class RequestBodyTest(TestCase):
|
|||
self.conn.request("PUT", "/url", b"body\xc1")
|
||||
message, f = self.get_headers_and_fp()
|
||||
self.assertEqual("text/plain", message.get_content_type())
|
||||
self.assertEqual(None, message.get_charset())
|
||||
self.assertIsNone(message.get_charset())
|
||||
self.assertEqual("5", message.get("content-length"))
|
||||
self.assertEqual(b'body\xc1', f.read())
|
||||
|
||||
|
@ -587,7 +587,7 @@ class RequestBodyTest(TestCase):
|
|||
self.conn.request("PUT", "/url", f)
|
||||
message, f = self.get_headers_and_fp()
|
||||
self.assertEqual("text/plain", message.get_content_type())
|
||||
self.assertEqual(None, message.get_charset())
|
||||
self.assertIsNone(message.get_charset())
|
||||
self.assertEqual("4", message.get("content-length"))
|
||||
self.assertEqual(b'body', f.read())
|
||||
|
||||
|
@ -598,7 +598,7 @@ class RequestBodyTest(TestCase):
|
|||
self.conn.request("PUT", "/url", f)
|
||||
message, f = self.get_headers_and_fp()
|
||||
self.assertEqual("text/plain", message.get_content_type())
|
||||
self.assertEqual(None, message.get_charset())
|
||||
self.assertIsNone(message.get_charset())
|
||||
self.assertEqual("5", message.get("content-length"))
|
||||
self.assertEqual(b'body\xc1', f.read())
|
||||
|
||||
|
|
|
@ -396,7 +396,7 @@ class ThreadTests(BaseTestCase):
|
|||
weak_cyclic_object = weakref.ref(cyclic_object)
|
||||
cyclic_object.thread.join()
|
||||
del cyclic_object
|
||||
self.assertEqual(None, weak_cyclic_object(),
|
||||
self.assertIsNone(weak_cyclic_object(),
|
||||
msg=('%d references still around' %
|
||||
sys.getrefcount(weak_cyclic_object())))
|
||||
|
||||
|
@ -404,7 +404,7 @@ class ThreadTests(BaseTestCase):
|
|||
weak_raising_cyclic_object = weakref.ref(raising_cyclic_object)
|
||||
raising_cyclic_object.thread.join()
|
||||
del raising_cyclic_object
|
||||
self.assertEqual(None, weak_raising_cyclic_object(),
|
||||
self.assertIsNone(weak_raising_cyclic_object(),
|
||||
msg=('%d references still around' %
|
||||
sys.getrefcount(weak_raising_cyclic_object())))
|
||||
|
||||
|
|
|
@ -341,8 +341,8 @@ class Win64WinregTests(BaseWinregTests):
|
|||
with OpenKey(HKEY_LOCAL_MACHINE, "Software") as key:
|
||||
# HKLM\Software is redirected but not reflected in all OSes
|
||||
self.assertTrue(QueryReflectionKey(key))
|
||||
self.assertEqual(None, EnableReflectionKey(key))
|
||||
self.assertEqual(None, DisableReflectionKey(key))
|
||||
self.assertIsNone(EnableReflectionKey(key))
|
||||
self.assertIsNone(DisableReflectionKey(key))
|
||||
self.assertTrue(QueryReflectionKey(key))
|
||||
|
||||
@unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")
|
||||
|
|
Loading…
Reference in New Issue