From cfcef973e832b70c148a2de43fef3d3b6cbb31ce Mon Sep 17 00:00:00 2001
From: Shuquan Huang <huang.shuquan@99cloud.net>
Date: Thu, 17 Dec 2015 11:31:29 +0800
Subject: [PATCH] Replace assertEqual(None, *) with assertIsNone in tests

Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.

Change-Id: Iad3f8fbb23a8b0f9e5ae4f304799465724c1a433
Closes-bug: #1280522
---
 ironic_python_agent/tests/unit/extensions/test_base.py | 8 ++++----
 ironic_python_agent/tests/unit/test_agent.py           | 2 +-
 ironic_python_agent/tests/unit/test_encoding.py        | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ironic_python_agent/tests/unit/extensions/test_base.py b/ironic_python_agent/tests/unit/extensions/test_base.py
index 5d68f1552..fb6c6f082 100644
--- a/ironic_python_agent/tests/unit/extensions/test_base.py
+++ b/ironic_python_agent/tests/unit/extensions/test_base.py
@@ -132,7 +132,7 @@ class TestExtensionDecorators(test_base.BaseTestCase):
         self.assertEqual({'param': 'v1'}, result.command_params)
         self.assertEqual(base.AgentCommandStatus.SUCCEEDED,
                          result.command_status)
-        self.assertEqual(None, result.command_error)
+        self.assertIsNone(result.command_error)
         self.assertEqual({'result': 'fake_async_command: v1'},
                          result.command_result)
         self.agent.force_heartbeat.assert_called_once_with()
@@ -146,7 +146,7 @@ class TestExtensionDecorators(test_base.BaseTestCase):
         self.assertEqual({'param': 'v1'}, result.command_params)
         self.assertEqual(base.AgentCommandStatus.SUCCEEDED,
                          result.command_status)
-        self.assertEqual(None, result.command_error)
+        self.assertIsNone(result.command_error)
         self.assertEqual({'result': 'fake_async_command: v1'},
                          result.command_result)
 
@@ -167,7 +167,7 @@ class TestExtensionDecorators(test_base.BaseTestCase):
         self.assertEqual(base.AgentCommandStatus.FAILED,
                          result.command_status)
         self.assertIsInstance(result.command_error, ExecutionError)
-        self.assertEqual(None, result.command_result)
+        self.assertIsNone(result.command_result)
         self.agent.force_heartbeat.assert_called_once_with()
 
     def test_async_command_name(self):
@@ -182,7 +182,7 @@ class TestExtensionDecorators(test_base.BaseTestCase):
         self.assertEqual({'param': 'v1'}, result.command_params)
         self.assertEqual(base.AgentCommandStatus.SUCCEEDED,
                          result.command_status)
-        self.assertEqual(None, result.command_error)
+        self.assertIsNone(result.command_error)
         self.assertEqual({'result': 'v1'}, result.command_result)
         # no need to force heartbeat on a sync command
         self.assertEqual(0, self.agent.force_heartbeat.call_count)
diff --git a/ironic_python_agent/tests/unit/test_agent.py b/ironic_python_agent/tests/unit/test_agent.py
index 6f3caa8a8..b41de50a3 100644
--- a/ironic_python_agent/tests/unit/test_agent.py
+++ b/ironic_python_agent/tests/unit/test_agent.py
@@ -271,7 +271,7 @@ class TestBaseAgent(test_base.BaseTestCase):
         self.assertRaises(errors.LookupAgentIPError,
                           homeless_agent.set_agent_advertise_addr)
         self.assertEqual(6, mock_get_ipv4.call_count)
-        self.assertEqual(None, homeless_agent.network_interface)
+        self.assertIsNone(homeless_agent.network_interface)
 
         # First interface eth0 has no IP, second interface eth1 has an IP
         mock_get_ipv4.side_effect = [None, '1.1.1.1']
diff --git a/ironic_python_agent/tests/unit/test_encoding.py b/ironic_python_agent/tests/unit/test_encoding.py
index 522dc9680..a54dc6ef7 100644
--- a/ironic_python_agent/tests/unit/test_encoding.py
+++ b/ironic_python_agent/tests/unit/test_encoding.py
@@ -59,4 +59,4 @@ class TestSerializableComparable(test_base.BaseTestCase):
     def test_childclass_hash(self):
         # Ensure __hash__ is None
         obj = SerializableComparableTesting('hello', 'world')
-        self.assertEqual(None, obj.__hash__)
+        self.assertIsNone(obj.__hash__)