ceph/qa/tasks/mgr/dashboard/test_api.py
Avan Thakkar 88a8732215 mgr/dashboard: make modified API endpoints backward compatible
Fixes: https://tracker.ceph.com/issues/52480
Signed-off-by: Avan Thakkar <athakkar@redhat.com>

Introducing APIVersion class to handle versioning for API-endpints and making
them backward compatible.
2021-09-24 18:48:35 +05:30

21 lines
561 B
Python

# -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from . import DEFAULT_API_VERSION
from .helper import DashboardTestCase
class VersionReqTest(DashboardTestCase, unittest.TestCase):
def test_version(self):
for (version, expected_status) in [
(DEFAULT_API_VERSION, 200),
(None, 415),
("99.99", 415)
]:
with self.subTest(version=version):
self._get('/api/summary', version=version)
self.assertStatus(expected_status)