]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/tests/test_versioning.py
import ceph pacific 16.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / tests / test_versioning.py
index d051e0550a48819748ff1672b0240fc8c5c6b4c6..666b388bf28844731b3f61c021b2f345be6d532f 100644 (file)
@@ -11,6 +11,7 @@ from . import ControllerTestCase  # pylint: disable=no-name-in-module
 class VTest(RESTController):
     RESOURCE_ID = "vid"
 
+    @RESTController.MethodMap(version="0.1")
     def list(self):
         return {'version': ""}
 
@@ -31,6 +32,15 @@ class RESTVersioningTest(ControllerTestCase, unittest.TestCase):
     def setup_server(cls):
         cls.setup_controllers([VTest], "/test")
 
+    def test_list(self):
+        for (version, expected_status) in [
+                ("0.1", 200),
+                ("2.0", 415)
+        ]:
+            with self.subTest(version=version):
+                self._get('/test/api/vtest', version=version)
+                self.assertStatus(expected_status)
+
     def test_v1(self):
         for (version, expected_status) in [
                 ("1.0", 200),