[openstack-dev] Problem with test_quotas.py in master branch

Nathan P Biles npbiles at us.ibm.com
Thu Feb 7 20:48:35 UTC 2013


I think I found a bug in tempest/tests/compute/test_quotas.py. It should 
be using assertEquals in test_get_default_quotas:

            self.assertEqual(expected_quota_set, quota_set)
            #self.assertSequenceEqual(expected_quota_set, quota_set)

I added some prints to dump the two objects and they are failing to report 
equal on my system because they are out of order, but all with the same 
values:

expected_quota_set:{'metadata_items': 128, 'ram': 51200, 
'security_group_rules': 20, 'instances': 10, 'key_pairs': 100, 'id': 
'450174c5232148c89c8879325f00b73e', 'security_groups': 10, 
'injected_file_content_bytes': 10240, 'floating_ips': 9, 'injected_files': 
5, 'cores': 20, 'injected_file_path_bytes': 255}

quota_set:{'injected_file_content_bytes': 10240, 'metadata_items': 128, 
'ram': 51200, 'floating_ips': 10, 'key_pairs': 100, 
'injected_file_path_bytes': 255, 'instances': 10, 'security_group_rules': 
20, 'injected_files': 5, 'cores': 20, 'id': 
'450174c5232148c89c8879325f00b73e', 'security_groups': 10}

But just using equals fixes it (the test passes when it should, and fails 
if I change one of the expected values in the 'set'). 

Does anyone know if sequence is really important here... should we change 
it to use equals, or does it need to be checking the sequence too (not 
sure that is even possible)? 

Thanks,
Nathan P Biles
Staff Software Engineer
Rochester, 015-2/D109
507-253-7818 (T/L: 553-7818)
npbiles at us.ibm.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130207/a256be2e/attachment.html>


More information about the OpenStack-dev mailing list