From 164a802718a1e026e78035bfaae9ffd047b4089e Mon Sep 17 00:00:00 2001 From: "sharat.sharma" Date: Mon, 23 May 2016 18:03:24 +0530 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: I98261ef7cca06447ea9d443a2c287c046f380f77 Closes-Bug: #1280522 --- watcher/tests/api/v1/test_actions_plans.py | 2 +- watcher/tests/api/v1/test_audits.py | 2 +- watcher/tests/api/v1/test_types.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/watcher/tests/api/v1/test_actions_plans.py b/watcher/tests/api/v1/test_actions_plans.py index 136c91c1c..ee0682f32 100644 --- a/watcher/tests/api/v1/test_actions_plans.py +++ b/watcher/tests/api/v1/test_actions_plans.py @@ -163,7 +163,7 @@ class TestListActionPlan(api_base.FunctionalTest): for id_ in range(0, 2): action_plan = response['action_plans'][id_] - self.assertEqual(None, action_plan['audit_uuid']) + self.assertIsNone(action_plan['audit_uuid']) for id_ in range(2, 4): action_plan = response['action_plans'][id_] diff --git a/watcher/tests/api/v1/test_audits.py b/watcher/tests/api/v1/test_audits.py index 0e7a0ecfa..e733659e4 100644 --- a/watcher/tests/api/v1/test_audits.py +++ b/watcher/tests/api/v1/test_audits.py @@ -306,7 +306,7 @@ class TestListAudit(api_base.FunctionalTest): for id_ in range(0, 2): audit = response['audits'][id_] - self.assertEqual(None, audit['audit_template_uuid']) + self.assertIsNone(audit['audit_template_uuid']) for id_ in range(2, 4): audit = response['audits'][id_] diff --git a/watcher/tests/api/v1/test_types.py b/watcher/tests/api/v1/test_types.py index 7557948a8..749b71197 100644 --- a/watcher/tests/api/v1/test_types.py +++ b/watcher/tests/api/v1/test_types.py @@ -234,7 +234,7 @@ class TestJsonType(base.TestCase): value = vt.validate({'foo': 'bar'}) self.assertEqual({'foo': 'bar'}, value) value = vt.validate(None) - self.assertEqual(None, value) + self.assertIsNone(value) def test_invalid_values(self): vt = types.jsontype