Add missing tests for 2.6 statuses

Two new statuses, 'importing' and 'uploading', were introduced in
version 2.6 of the API.  Update the controller tests that check the
validity of location modifications for various image statuses to
include tests for 'importing' and 'uploading'.

Change-Id: I114ec6d7cfba6b918321ac7086b03955c266c770
This commit is contained in:
Brian Rosmaita 2018-08-22 14:25:25 -04:00
parent 9657073262
commit 6ee51d2000
1 changed files with 18 additions and 0 deletions

View File

@ -1799,6 +1799,12 @@ class TestImagesController(base.IsolatedUnitTest):
def test_location_add_not_permitted_status_killed(self):
self._test_update_locations_status('killed', 'add')
def test_location_add_not_permitted_status_importing(self):
self._test_update_locations_status('importing', 'add')
def test_location_add_not_permitted_status_uploading(self):
self._test_update_locations_status('uploading', 'add')
def test_location_remove_not_permitted_status_saving(self):
self._test_update_locations_status('saving', 'remove')
@ -1817,6 +1823,12 @@ class TestImagesController(base.IsolatedUnitTest):
def test_location_remove_not_permitted_status_queued(self):
self._test_update_locations_status('queued', 'remove')
def test_location_remove_not_permitted_status_importing(self):
self._test_update_locations_status('importing', 'remove')
def test_location_remove_not_permitted_status_uploading(self):
self._test_update_locations_status('uploading', 'remove')
def test_location_replace_not_permitted_status_saving(self):
self._test_update_locations_status('saving', 'replace')
@ -1832,6 +1844,12 @@ class TestImagesController(base.IsolatedUnitTest):
def test_location_replace_not_permitted_status_killed(self):
self._test_update_locations_status('killed', 'replace')
def test_location_replace_not_permitted_status_importing(self):
self._test_update_locations_status('importing', 'replace')
def test_location_replace_not_permitted_status_uploading(self):
self._test_update_locations_status('uploading', 'replace')
def test_update_add_locations_insertion(self):
self.config(show_multiple_locations=True)
new_location = {'url': '%s/fake_location' % BASE_URI, 'metadata': {}}