Duplicate test case 'test_exceed_append_location' in unit/test_quota.py

Bug #1259036 reported by Feilong Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Steve Kowalik

Bug Description

Duplicate test case name in unit/test_quota.py, see https://github.com/openstack/glance/blob/master/glance/tests/unit/test_quota.py#L193

    def test_exceed_append_location(self):
        image_size = 10
        max_images = 2
        quota = image_size * max_images
        self.config(user_storage_quota=quota)
        image = self._get_image(image_size=image_size,
                                location_count=max_images)
        self.assertRaises(exception.StorageQuotaFull,
                          image.locations.append,
                          {'url': 'file:///a/path', 'metadata': {}})

    def test_exceed_append_location(self):
        image_size = 10
        max_images = 2
        quota = image_size * max_images
        self.config(user_storage_quota=quota)
        image = self._get_image(image_size=image_size,
                                location_count=max_images)
        self.assertRaises(exception.StorageQuotaFull,
                          image.locations.insert,
                          0,
                          {'url': 'file:///a/path', 'metadata': {}})

Revision history for this message
Feilong Wang (flwang) wrote :

And I would like to see the test case name 'test_iadd_location' can be refactored, see https://github.com/openstack/glance/blob/master/glance/tests/unit/test_quota.py#L179 because I didn't see any justification to use 'iadd'

Steve Kowalik (stevenk)
Changed in glance:
assignee: nobody → Steve Kowalik (stevenk)
Changed in glance:
status: Triaged → In Progress
Revision history for this message
Feilong Wang (flwang) wrote :

Steve, thanks for working on this. Do you think the #1 comments is reasonable?

Revision history for this message
Feilong Wang (flwang) wrote :

Pls skip my comment #1, I think the 'iadd' is for __iadd__, sorry for the confusion.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/60740
Committed: http://github.com/openstack/glance/commit/9adee277017b9ae4cd600052b6af537427305ede
Submitter: Jenkins
Branch: master

commit 9adee277017b9ae4cd600052b6af537427305ede
Author: Steve Kowalik <email address hidden>
Date: Mon Dec 9 16:14:56 2013 +1100

    Refactor StorageQuotaFull test cases in test_quota

    There were two test cases in test_quota that shared the same name, but
    did almost the same thing. After a bit of digging, it looked like most
    of the test cases did the almost same thing, so I refactored the common
    bits and fixed the test case name duplication.

    Partial-Bug: #1259036
    Change-Id: I828eea570d358d98520c7201454c03ba174a35ad

Steve Kowalik (stevenk)
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.