2020-06-22 15:23:16 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
2021-09-23 11:15:16 +00:00
|
|
|
from . import DEFAULT_API_VERSION
|
2020-06-22 15:23:16 +00:00
|
|
|
from .helper import DashboardTestCase
|
|
|
|
|
|
|
|
|
|
|
|
class VersionReqTest(DashboardTestCase, unittest.TestCase):
|
|
|
|
def test_version(self):
|
|
|
|
for (version, expected_status) in [
|
2021-09-23 11:15:16 +00:00
|
|
|
(DEFAULT_API_VERSION, 200),
|
2020-06-22 15:23:16 +00:00
|
|
|
(None, 415),
|
|
|
|
("99.99", 415)
|
|
|
|
]:
|
|
|
|
with self.subTest(version=version):
|
|
|
|
self._get('/api/summary', version=version)
|
|
|
|
self.assertStatus(expected_status)
|