]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not assume order of quotas dictionary elements
authorHenry Gessau <gessau@cisco.com>
Sun, 3 Aug 2014 17:40:01 +0000 (13:40 -0400)
committerHenry Gessau <gessau@cisco.com>
Sun, 3 Aug 2014 17:42:41 +0000 (13:42 -0400)
commit5c93dfaf25c81576ddc664d2d30ef8297eb367e1
treee133b6b77d7125c7dfcfa41cc782c95cf3383b6b
parenta566fb79ba2ada52a61ab7b08a632773a48da8d4
Do not assume order of quotas dictionary elements

This fixes the quotas db unit test that breaks with a randomized PYTHONHASHSEED
(see the bug report).

The test assumed that the quotas dictionary from plugin.get_all_quotas() had
elements in a particular order. Found with PYTHONHASHSEED=1235130571.

The fix refactors the test case to handle an unsorted quotas dictionary. Also
choose some different quota limits to make it clearer what is being verified.

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: I3892b51082629e6ebce175f64f501717741baa37
neutron/tests/unit/db/test_quota_db.py