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

This commit is contained in:
Jenkins 2016-01-10 04:35:30 +00:00 committed by Gerrit Code Review
commit c28424798d
3 changed files with 12 additions and 12 deletions

View File

@ -159,7 +159,7 @@ class TestHealthMonitors(base.BaseTestCase):
hm_test = self.health_monitors_client.get_health_monitor(hm.get('id'))
self.assertEqual(hm, hm_test)
self.assertEqual(True, hm_test.get('admin_state_up'))
self.assertTrue(hm_test.get('admin_state_up'))
@test.attr(type='smoke')
def test_create_health_monitor_missing_http_method(self):
@ -371,7 +371,7 @@ class TestHealthMonitors(base.BaseTestCase):
timeout=5, pool_id=self.pool.get('id'))
new_hm = self._update_health_monitor(hm.get('id'))
self.assertEqual(True, new_hm.get('admin_state_up'))
self.assertTrue(new_hm.get('admin_state_up'))
@test.attr(type='smoke')
def test_update_health_monitor_missing_delay(self):

View File

@ -103,7 +103,7 @@ class MemberTestJSON(base.BaseTestCase):
self.assertEqual(80, member["protocol_port"])
self.assertEqual(self.subnet_id, member["subnet_id"])
# Should have default values for admin_state_up and weight
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
@test.attr(type='smoke')
@ -313,7 +313,7 @@ class MemberTestJSON(base.BaseTestCase):
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member['id'])
# Make sure the defaults are correct
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
# Lets overwrite the defaults
member_opts = {"weight": 10, "admin_state_up": False}
@ -331,12 +331,12 @@ class MemberTestJSON(base.BaseTestCase):
**member_opts)
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member_id)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
member_opts = {"weight": 10}
member = self._update_member(self.pool_id, member_id,
**member_opts)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(10, member["weight"])
@test.attr(type='smoke')
@ -347,7 +347,7 @@ class MemberTestJSON(base.BaseTestCase):
**member_opts)
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member_id)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
member_opts = {"admin_state_up": False}
member = self._update_member(self.pool_id, member_id,
@ -363,7 +363,7 @@ class MemberTestJSON(base.BaseTestCase):
**member_opts)
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member_id)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
member_opts = {"weight": 10, "admin_state_up": "%^67"}
self.assertRaises(ex.BadRequest, self._update_member,
@ -377,7 +377,7 @@ class MemberTestJSON(base.BaseTestCase):
**member_opts)
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member_id)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
member_opts = {"admin_state_up": False, "weight": "*^$df"}
self.assertRaises(ex.BadRequest, self._update_member,
@ -391,7 +391,7 @@ class MemberTestJSON(base.BaseTestCase):
**member_opts)
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member_id)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
member_opts = {"weight": 10, "admin_state_up": ""}
self.assertRaises(ex.BadRequest, self._update_member,
@ -405,7 +405,7 @@ class MemberTestJSON(base.BaseTestCase):
**member_opts)
member_id = member["id"]
self.addCleanup(self._delete_member, self.pool_id, member_id)
self.assertEqual(True, member["admin_state_up"])
self.assertTrue(member["admin_state_up"])
self.assertEqual(1, member["weight"])
member_opts = {"admin_state_up": False, "weight": ""}
self.assertRaises(ex.BadRequest, self._update_member,

View File

@ -86,7 +86,7 @@ class TestOctaviaDriver(BaseOctaviaDriverTest):
'allocates_vip', group='octavia')
cfg.CONF.set_override('allocates_vip', True, group='octavia')
test_driver = driver.OctaviaDriver(self.plugin)
self.assertEqual(True, test_driver.load_balancer.allocates_vip)
self.assertTrue(test_driver.load_balancer.allocates_vip)
def test_load_balancer_ops(self):
m = ManagerTest(self, self.driver.load_balancer,