From ec1a3dabde035da4ef8e67194bc9ef5bca832490 Mon Sep 17 00:00:00 2001 From: llg8212 Date: Sat, 15 Feb 2014 12:09:02 +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: I5ef78693999f9bd87cc3ea8419e6e62027076383 Closes-Bug:#1280522 --- tuskar/tests/api/controllers/v1/test_models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tuskar/tests/api/controllers/v1/test_models.py b/tuskar/tests/api/controllers/v1/test_models.py index 882579a5..bdb88063 100644 --- a/tuskar/tests/api/controllers/v1/test_models.py +++ b/tuskar/tests/api/controllers/v1/test_models.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import unittest +import testtools from wsme import types as wtypes @@ -20,7 +20,7 @@ from tuskar.api.controllers.v1 import models as api_models from tuskar.db.sqlalchemy import models as db_models -class BaseTests(unittest.TestCase): +class BaseTests(testtools.TestCase): def test_lookup(self): # Setup @@ -32,10 +32,10 @@ class BaseTests(unittest.TestCase): # Test self.assertEqual(1, stub._lookup('a1')) - self.assertEqual(None, stub._lookup('a2')) + self.assertIsNone(stub._lookup('a2')) -class OvercloudModelTests(unittest.TestCase): +class OvercloudModelTests(testtools.TestCase): def test_from_db_model(self): # Setup