mirror of
https://github.com/ceph/ceph
synced 2025-01-24 03:53:54 +00:00
88a8732215
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.
21 lines
561 B
Python
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)
|