From da89e213e689d34f4c7a7ba10edc0b59a380e1b5 Mon Sep 17 00:00:00 2001 From: Eva Balycheva Date: Fri, 9 Oct 2015 17:56:22 +0300 Subject: [PATCH] Fix incorrect usage of assertEqual() in some tests Incorrect usage of assertEqual() method is found in some tests: "assertEqual(True, ...)". The correct way is to use "assertTrue(...)" in such cases. This commit will substitute all occurences of "assertEqual(True, ...)" in tests to correct form: "assertTrue(...)". Change-Id: I1ad9ce1299e67c4c649fa7b05b245c5ad4496f43 Closes-Bug: 1504368 --- .../tests/functional/wsgi/v1_1/test_health.py | 4 ++-- zaqar/tests/unit/storage/base.py | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zaqar/tests/functional/wsgi/v1_1/test_health.py b/zaqar/tests/functional/wsgi/v1_1/test_health.py index 7c049b834..7cc197aad 100644 --- a/zaqar/tests/functional/wsgi/v1_1/test_health.py +++ b/zaqar/tests/functional/wsgi/v1_1/test_health.py @@ -74,8 +74,8 @@ class TestHealth(base.V1_1FunctionalTestBase): self.assertEqual(200, response.status_code) health = response.json() - self.assertEqual(True, health['catalog_reachable']) - self.assertEqual(True, health[pool_name]['storage_reachable']) + self.assertTrue(health['catalog_reachable']) + self.assertTrue(health[pool_name]['storage_reachable']) op_status = health[pool_name]['operation_status'] for op in op_status.keys(): self.assertTrue(op_status[op]['succeeded']) diff --git a/zaqar/tests/unit/storage/base.py b/zaqar/tests/unit/storage/base.py index e96280e76..77306ef8d 100644 --- a/zaqar/tests/unit/storage/base.py +++ b/zaqar/tests/unit/storage/base.py @@ -133,18 +133,18 @@ class QueueControllerTest(ControllerBaseTest): detailed=True) queues = list(next(interaction)) - self.assertEqual(True, all(map(lambda queue: - 'name' in queue and - 'metadata' in queue, queues))) + self.assertTrue(all(map(lambda queue: + 'name' in queue and + 'metadata' in queue, queues))) self.assertEqual(10, len(queues)) interaction = self.controller.list(project=project, marker=next(interaction)) queues = list(next(interaction)) - self.assertEqual(True, all(map(lambda queue: - 'name' in queue and - 'metadata' not in queue, queues))) + self.assertTrue(all(map(lambda queue: + 'name' in queue and + 'metadata' not in queue, queues))) self.assertEqual(5, len(queues)) @@ -1004,9 +1004,9 @@ class SubscriptionControllerTest(ControllerBaseTest): project=self.project) subscriptions = list(next(interaction)) - self.assertEqual(True, all(map(lambda s: - 'source' in s and 'subscriber' in s, - subscriptions))) + self.assertTrue(all(map(lambda s: + 'source' in s and 'subscriber' in s, + subscriptions))) self.assertEqual(10, len(subscriptions)) interaction = (self.subscription_controller.list(self.source, @@ -1014,9 +1014,9 @@ class SubscriptionControllerTest(ControllerBaseTest): marker=next(interaction))) subscriptions = list(next(interaction)) - self.assertEqual(True, all(map(lambda s: - 'source' in s and 'subscriber' in s, - subscriptions))) + self.assertTrue(all(map(lambda s: + 'source' in s and 'subscriber' in s, + subscriptions))) self.assertEqual(5, len(subscriptions)) def test_get_raises_if_subscription_does_not_exist(self):