]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not assume order of convert_kvp_list_to_dict method responses
authorCedric Brandily <zzelle@gmail.com>
Wed, 27 May 2015 12:54:35 +0000 (14:54 +0200)
committerCedric Brandily <zzelle@gmail.com>
Wed, 27 May 2015 12:54:35 +0000 (14:54 +0200)
commitce957ac83a85a421f2e60cc39a3103291ba95e4a
tree5578babbdb33f83130f0175aad859b011a1161ec
parent539738a8eeebcc9f22987fcb0a241c6b8c3d561a
Do not assume order of convert_kvp_list_to_dict method responses

This fixes the test_attributes unit tests[1] that breaks with a
randomized PYTHONHASHSEED (see the bug report).

The test assumed that the convert_kvp_list_to_dict method from
neutron.api.v2.attributes returned elements in a particular
order. Found with PYTHONHASHSEED=1.

The fix refactors the test case to handle unsorted responses from
convert_kvp_list_to_dict.

[1] neutron.tests.unit.api.v2.test_attributes.TestConvertKvp

Partial-bug: #1348818

Note: There are several other unrelated unit tests that also break with
a randomized PYTHONHASHSEED, but they are not addressed here. They will
be addressed in separate patches.

Change-Id: I864904db1428b88c482ad17a69b33e876a8d042c
neutron/tests/unit/api/v2/test_attributes.py