| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 8 | class TestSwagger(unittest.TestCase): |
||
| 9 | @classmethod |
||
| 10 | def setUpClass(cls): |
||
| 11 | cls.client = server.test_client() |
||
| 12 | |||
| 13 | def test_get_spec(self): |
||
| 14 | """ The GET on /spec should return a 200 """ |
||
| 15 | |||
| 16 | with warnings.catch_warnings(): |
||
| 17 | warnings.filterwarnings("ignore", message="unclosed file") |
||
| 18 | response = self.client.get('/application/spec') |
||
| 19 | self.assertEqual(response.status_code, 200) |
||
| 20 | |||
| 21 | def test_swagger_is_not_empty(self): |
||
| 22 | """ |
||
| 23 | The GET on /spec should return a dict with a non-empty paths property |
||
| 24 | """ |
||
| 25 | |||
| 26 | with warnings.catch_warnings(): |
||
| 27 | warnings.filterwarnings("ignore", message="unclosed file") |
||
| 28 | response = self.client.get('/application/spec') |
||
| 29 | response_json = json.loads(response.data.decode('utf-8')) |
||
| 30 | self.assertTrue(response_json['paths']) |
||
| 31 |