From 12d42efad23f95461692af99a77136d7591a5fee Mon Sep 17 00:00:00 2001 From: howardlee Date: Fri, 18 Nov 2016 15:26:14 +0800 Subject: [PATCH] Replace 'assertEqual(None, ...)' with 'assertIsNone(...)' [H203] Use assertIs(Not)None to check for None (off by default) Unit test assertions tend to give better messages for more specific assertions. As a result, assertIsNone(...) is preferred over assertEqual(None, ...) and assertIs(None, ...), and assertIsNotNone(...) is preferred over assertNotEqual(None, ...) and assertIsNot(None, ...). Off by default. More details, see: http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises Trivial fix. Change-Id: Icd268b96dea5e5bb9bd344f597dfcd9cc82253f0 --- tests/unit/test_authv1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_authv1.py b/tests/unit/test_authv1.py index 968109a5..2ddf24b3 100644 --- a/tests/unit/test_authv1.py +++ b/tests/unit/test_authv1.py @@ -174,7 +174,7 @@ class TestPlugin(TestDataNoAccount, unittest.TestCase): auth_plugin = authv1.PasswordPlugin(**self.options) self.mock_response.headers['X-Auth-Token-Expires'] = 'foo' access = auth_plugin.get_access(self.mock_session) - self.assertEqual(None, access.expires) + self.assertIsNone(access.expires) self.assertIs(False, access.will_expire_soon(60)) self.assertIs(False, access.will_expire_soon(1e20))