summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhowardlee <lihongweibj@inspur.com>2016-11-18 15:26:14 +0800
committerhowardlee <lihongweibj@inspur.com>2016-11-18 15:26:14 +0800
commit12d42efad23f95461692af99a77136d7591a5fee (patch)
tree480071cf4cb62f91af1eff419d82d4e3488e5972
parent5a620f83e88d1b52e013cedff4bc266bcf3c292a (diff)
downloadpython-swiftclient-12d42efad23f95461692af99a77136d7591a5fee.tar.gz
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
-rw-r--r--tests/unit/test_authv1.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/test_authv1.py b/tests/unit/test_authv1.py
index 968109a..2ddf24b 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))