From 4c3d247192a19a0f0cb7ea5f2145409abb070828 Mon Sep 17 00:00:00 2001 From: howardlee <lihongweibj@inspur.com> Date: Thu, 3 Nov 2016 16:45:23 +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. TrivialFix Change-Id: Ib635a7f73c9ab86ca6ca322542b19e7889486070 --- manila/tests/share/drivers/container/test_container_helper.py | 2 +- manila/tests/share/drivers/zfssa/test_zfssashare.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manila/tests/share/drivers/container/test_container_helper.py b/manila/tests/share/drivers/container/test_container_helper.py index 1999f0ce0b..637c2ecee2 100644 --- a/manila/tests/share/drivers/container/test_container_helper.py +++ b/manila/tests/share/drivers/container/test_container_helper.py @@ -107,4 +107,4 @@ class DockerExecHelperTestCase(test.TestCase): result = self.DockerExecHelper._inner_execute("fake_command") - self.assertEqual(result, None) + self.assertIsNone(result) diff --git a/manila/tests/share/drivers/zfssa/test_zfssashare.py b/manila/tests/share/drivers/zfssa/test_zfssashare.py index f1cb0c5f45..54b33bbdcd 100644 --- a/manila/tests/share/drivers/zfssa/test_zfssashare.py +++ b/manila/tests/share/drivers/zfssa/test_zfssashare.py @@ -506,7 +506,7 @@ class ZFSSAShareDriverTestCase(test.TestCase): ret = self._driver._verify_share_to_manage('sharename', {}) - self.assertEqual(ret, None) + self.assertIsNone(ret) # Change it back to strict self.configuration.zfssa_manage_policy = 'strict'