The test_list_availability_zones_enabled_service test calls
a method which returns a tuple that is generated from a dict.
This is compared to a tuple in the test, which can fail when
PYTHONHASHSEED is not 0, due to the tuples containing elements
in different orders. (Because the dict used to build the tuple
was ordered differently.)
For this test, we can convert to lists and sort them to do the
comparison, since the ordering is not important.
Partial-Bug: #
1348818
Change-Id: Ib7e5d59073e5e243450e28492d68942f6088bb5f
volume_api = cinder.volume.api.API()
azs = volume_api.list_availability_zones()
+ azs = list(azs).sort()
- expected = (
+ expected = [
{'name': 'pung', 'available': False},
{'name': 'pong', 'available': True},
{'name': 'ping', 'available': True},
- )
+ ].sort()
self.assertEqual(expected, azs)
def list_availability_zones(self, enable_cache=False):
"""Describe the known availability zones
- :retval list of dicts, each with a 'name' and 'available' key
+ :retval tuple of dicts, each with a 'name' and 'available' key
"""
refresh_cache = False
if enable_cache: