Browse Source

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
tags/18.0.0.0b1
Brian Rosmaita 11 months ago
parent
commit
6ee51d2000
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      glance/tests/unit/v2/test_images_resource.py

+ 18
- 0
glance/tests/unit/v2/test_images_resource.py View File

@@ -1799,6 +1799,12 @@ class TestImagesController(base.IsolatedUnitTest):
1799 1799
     def test_location_add_not_permitted_status_killed(self):
1800 1800
         self._test_update_locations_status('killed', 'add')
1801 1801
 
1802
+    def test_location_add_not_permitted_status_importing(self):
1803
+        self._test_update_locations_status('importing', 'add')
1804
+
1805
+    def test_location_add_not_permitted_status_uploading(self):
1806
+        self._test_update_locations_status('uploading', 'add')
1807
+
1802 1808
     def test_location_remove_not_permitted_status_saving(self):
1803 1809
         self._test_update_locations_status('saving', 'remove')
1804 1810
 
@@ -1817,6 +1823,12 @@ class TestImagesController(base.IsolatedUnitTest):
1817 1823
     def test_location_remove_not_permitted_status_queued(self):
1818 1824
         self._test_update_locations_status('queued', 'remove')
1819 1825
 
1826
+    def test_location_remove_not_permitted_status_importing(self):
1827
+        self._test_update_locations_status('importing', 'remove')
1828
+
1829
+    def test_location_remove_not_permitted_status_uploading(self):
1830
+        self._test_update_locations_status('uploading', 'remove')
1831
+
1820 1832
     def test_location_replace_not_permitted_status_saving(self):
1821 1833
         self._test_update_locations_status('saving', 'replace')
1822 1834
 
@@ -1832,6 +1844,12 @@ class TestImagesController(base.IsolatedUnitTest):
1832 1844
     def test_location_replace_not_permitted_status_killed(self):
1833 1845
         self._test_update_locations_status('killed', 'replace')
1834 1846
 
1847
+    def test_location_replace_not_permitted_status_importing(self):
1848
+        self._test_update_locations_status('importing', 'replace')
1849
+
1850
+    def test_location_replace_not_permitted_status_uploading(self):
1851
+        self._test_update_locations_status('uploading', 'replace')
1852
+
1835 1853
     def test_update_add_locations_insertion(self):
1836 1854
         self.config(show_multiple_locations=True)
1837 1855
         new_location = {'url': '%s/fake_location' % BASE_URI, 'metadata': {}}

Loading…
Cancel
Save