Use assertTrue/False instead of assertEqual(T/F)

The usage of assertEqual(True/False, ***) should be changed
to a meaningful format of assertTrue/False(***).

Change-Id: Ia0dbff2b4af390b8ea46fe7bf0d512b8bade804b
Closes-Bug:#1512207
This commit is contained in:
Swapnil Kulkarni (coolsvap) 2016-01-06 20:42:50 +05:30
parent 4fcea6cb35
commit 176d31acfe
4 changed files with 9 additions and 9 deletions

View File

@ -131,7 +131,7 @@ class WhenTestingSecretACLRepository(database_utils.RepositoryTestCase,
self.assertEqual(3, len(acls))
id_map = self._map_id_to_acl(acls)
self.assertEqual(True, id_map[acl1.id].project_access)
self.assertTrue(id_map[acl1.id].project_access)
self.assertFalse(id_map[acl2.id].project_access)
self.assertEqual('read', id_map[acl1.id].operation)
self.assertEqual('write', id_map[acl2.id].operation)
@ -212,8 +212,8 @@ class WhenTestingSecretACLRepository(database_utils.RepositoryTestCase,
self.assertEqual(3, len(acls))
self.assertFalse(id_map[acl1.id].project_access)
self.assertEqual(True, id_map[acl2.id].project_access)
self.assertEqual(True, id_map[acl3.id].project_access)
self.assertTrue(id_map[acl2.id].project_access)
self.assertTrue(id_map[acl3.id].project_access)
self._assert_acl_users(['u5'], acls, acl1.id)
self._assert_acl_users(['u1', 'u2', 'u3', 'u4'], acls, acl2.id)
self._assert_acl_users(['u1', 'u2', 'u4'], acls, acl3.id)
@ -382,7 +382,7 @@ class WhenTestingContainerACLRepository(database_utils.RepositoryTestCase,
self.assertEqual(3, len(acls))
id_map = self._map_id_to_acl(acls)
self.assertEqual(True, id_map[acl1.id].project_access)
self.assertTrue(id_map[acl1.id].project_access)
self.assertFalse(id_map[acl2.id].project_access)
self.assertEqual('read', id_map[acl1.id].operation)
self.assertEqual('write', id_map[acl2.id].operation)
@ -463,8 +463,8 @@ class WhenTestingContainerACLRepository(database_utils.RepositoryTestCase,
self.assertEqual(3, len(acls))
self.assertFalse(id_map[acl1.id].project_access)
self.assertEqual(True, id_map[acl2.id].project_access)
self.assertEqual(True, id_map[acl3.id].project_access)
self.assertTrue(id_map[acl2.id].project_access)
self.assertTrue(id_map[acl3.id].project_access)
self._assert_acl_users(['u5'], acls, acl1.id)
self._assert_acl_users(['u1', 'u2', 'u3', 'u4'], acls, acl2.id)
self._assert_acl_users(['u1', 'u2', 'u4'], acls, acl3.id)

View File

@ -439,7 +439,7 @@ class WhenCreatingNewContainerACL(utils.BaseTestCase):
True, user_ids=user_ids)
self.assertEqual(self.container_id, acl.container_id)
self.assertEqual(self.operation, acl.operation)
self.assertEqual(True, acl.project_access)
self.assertTrue(acl.project_access)
self.assertEqual(2, len(acl.acl_users))
def test_should_throw_exception_missing_container_id(self):

View File

@ -259,7 +259,7 @@ class WhenCallingScheduleOrderRetryTasks(database_utils.RepositoryTestCase):
# small amount of time.
delta = retry_model.retry_at - self.date_to_retry_at
delta_seconds = delta.seconds
self.assertEqual(True, delta_seconds <= 2)
self.assertTrue(delta_seconds <= 2)
class WhenCallingTasksMethod(utils.BaseTestCase):

View File

@ -42,4 +42,4 @@ class WhenUsingFollowOnProcessingStatusDTO(utils.BaseTestCase):
def test_should_indicate_follow_on_when_retry_task_provided(self):
self.target.retry_task = common.RetryTasks.INVOKE_SAME_TASK
self.assertEqual(True, self.target.is_follow_on_needed())
self.assertTrue(self.target.is_follow_on_needed())