diff options
author | Shuquan Huang <huang.shuquan@99cloud.net> | 2015-12-17 11:19:11 +0800 |
---|---|---|
committer | Shuquan Huang <huang.shuquan@99cloud.net> | 2015-12-17 11:20:13 +0800 |
commit | e4503e43cbfd7cff5754584f16fea354c265802f (patch) | |
tree | 667640174b600b49abff4e3d5d40dd2fe8e1f033 | |
parent | 6571e5ab646f55ba9411f5a668c5224203a08707 (diff) | |
download | heat-cfntools-e4503e43cbfd7cff5754584f16fea354c265802f.tar.gz |
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: Ic2dca04e7cdd4f837c42b39dd1ce37604c8f101b
Closes-bug: #1280522
-rw-r--r-- | heat_cfntools/tests/test_cfn_helper.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/heat_cfntools/tests/test_cfn_helper.py b/heat_cfntools/tests/test_cfn_helper.py index 06e6caf..d13324a 100644 --- a/heat_cfntools/tests/test_cfn_helper.py +++ b/heat_cfntools/tests/test_cfn_helper.py @@ -823,8 +823,7 @@ class TestCfnHelper(testtools.TestCase): def test_metadata_server_nofile(self): random_filename = self.getUniqueString() - self.assertEqual(None, - cfn_helper.metadata_server_port(random_filename)) + self.assertIsNone(cfn_helper.metadata_server_port(random_filename)) def test_to_boolean(self): self.assertTrue(cfn_helper.to_boolean(True)) @@ -1171,7 +1170,7 @@ class TestMetadataRetrieve(testtools.TestCase): mock_popen.side_effect = write_cache_file md = cfn_helper.Metadata('teststack', None) meta_out = md.get_nova_meta(cache_path=cache_path) - self.assertEqual(None, meta_out) + self.assertIsNone(meta_out) mock_popen.assert_has_calls( popen_root_calls([['curl', '-o', cache_path, url]])) @@ -1190,7 +1189,7 @@ class TestMetadataRetrieve(testtools.TestCase): mock_popen.return_value = FakePOpen('Failed', '', 1) md = cfn_helper.Metadata('teststack', None) meta_out = md.get_nova_meta(cache_path=cache_path) - self.assertEqual(None, meta_out) + self.assertIsNone(meta_out) mock_popen.assert_has_calls( popen_root_calls([['curl', '-o', cache_path, url]])) |