Replace assertEqual([], items) with assertEmpty(items)

Since assertEmpty() function has already been implemented,
let's use this function instead of generic assertEqual() function.
This change makes the code and the error messages to be more readable.
Therefore it improves maintainability a little bit.

Change-Id: Ibbc698eae826a82f7a09f665ac643051f37e7d41
This commit is contained in:
Vu Cong Tuan 2017-06-12 16:25:34 +07:00
parent 55e6c6f87a
commit a82ef9d5f5
2 changed files with 2 additions and 2 deletions

View File

@ -399,7 +399,7 @@ class LoadBalancersTestJSON(base.BaseTestCase):
load_balancer = statuses['loadbalancer']
self.assertEqual("ONLINE", load_balancer['operating_status'])
self.assertEqual("ACTIVE", load_balancer['provisioning_status'])
self.assertEqual([], load_balancer['listeners'])
self.assertEmpty(load_balancer['listeners'])
@test.attr(type='smoke')
def test_get_load_balancer_stats(self):

View File

@ -82,7 +82,7 @@ class TestPools(base.BaseTestCase):
def test_list_pools_empty(self):
"""Test get pools when empty"""
pools = self.pools_client.list_pools()
self.assertEqual([], pools)
self.assertEmpty(pools)
def test_list_pools_one(self):
"""Test get pools with one pool"""