diff options
| author | jfriedli | 2021-11-01 16:06:05 +0100 |
|---|---|---|
| committer | Jan Friedli | 2021-11-01 16:14:34 +0100 |
| commit | 2f527a7a13df7858584c36baf98a68e32d265f10 (patch) | |
| tree | ff9cc3b943ce8ade756f016e711bd510b1fc618c /test/test_api.py | |
| parent | 8b0c7717e365deb16c8a1105ba10611c4f7c6909 (diff) | |
use main flasgger lib and workaround a know and unsolved problem
Diffstat (limited to 'test/test_api.py')
| -rw-r--r-- | test/test_api.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_api.py b/test/test_api.py index 427a1f1..3cc44a6 100644 --- a/test/test_api.py +++ b/test/test_api.py | |||
| @@ -145,6 +145,7 @@ class Mat2APITestCase(unittest.TestCase): | |||
| 145 | 'FcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}', | 145 | 'FcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}', |
| 146 | headers={'content-type': 'application/json'} | 146 | headers={'content-type': 'application/json'} |
| 147 | ) | 147 | ) |
| 148 | print(request.get_json()) | ||
| 148 | self.assertEqual(request.status_code, 201) | 149 | self.assertEqual(request.status_code, 201) |
| 149 | data = request.get_json() | 150 | data = request.get_json() |
| 150 | 151 | ||
| @@ -196,8 +197,8 @@ class Mat2APITestCase(unittest.TestCase): | |||
| 196 | 'FcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}', | 197 | 'FcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}', |
| 197 | headers={'content-type': 'application/json'} | 198 | headers={'content-type': 'application/json'} |
| 198 | ) | 199 | ) |
| 199 | self.assertEqual(request.status_code, 201) | ||
| 200 | upload_one = request.get_json() | 200 | upload_one = request.get_json() |
| 201 | self.assertEqual(request.status_code, 201) | ||
| 201 | 202 | ||
| 202 | request = self.app.post('/api/upload', | 203 | request = self.app.post('/api/upload', |
| 203 | data='{"file_name": "test_name_two.jpg", ' | 204 | data='{"file_name": "test_name_two.jpg", ' |
| @@ -460,6 +461,8 @@ class Mat2APITestCase(unittest.TestCase): | |||
| 460 | 461 | ||
| 461 | def test_valid_opena_api_spec(self): | 462 | def test_valid_opena_api_spec(self): |
| 462 | spec = self.app.get('apispec_1.json').get_json() | 463 | spec = self.app.get('apispec_1.json').get_json() |
| 464 | # Test workaround due to https://github.com/flasgger/flasgger/issues/374 | ||
| 465 | del spec['definitions'] | ||
| 463 | validate_spec(spec) | 466 | validate_spec(spec) |
| 464 | 467 | ||
| 465 | def test_remove_metadata(self): | 468 | def test_remove_metadata(self): |
