diff options
| author | Jfriedli | 2021-03-23 21:20:54 +0100 |
|---|---|---|
| committer | Jfriedli | 2021-03-23 21:20:54 +0100 |
| commit | c0d8d6c8eb74d839e520cd2e4429763208b478dd (patch) | |
| tree | 2aa90ac6bb593a6a29ba357d3d840bcefcb644ad /test | |
| parent | 501ecbf97e342c6d3a4c5d89131937f615cc98cf (diff) | |
catch newly thrown ValueErrors on get_file_parserv0.7.0
Diffstat (limited to 'test')
| -rw-r--r-- | test/test.py | 2 | ||||
| -rw-r--r-- | test/test_api.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/test.py b/test/test.py index 3666457..d9d0fbf 100644 --- a/test/test.py +++ b/test/test.py | |||
| @@ -63,7 +63,7 @@ class Mat2WebTestCase(TestCase): | |||
| 63 | data=dict( | 63 | data=dict( |
| 64 | file=(io.BytesIO(b""), 'test.pdf'), | 64 | file=(io.BytesIO(b""), 'test.pdf'), |
| 65 | ), follow_redirects=True) | 65 | ), follow_redirects=True) |
| 66 | self.assertIn(b'The type application/pdf is not supported', | 66 | self.assertIn(b'The filetype is not supported', |
| 67 | rv.data) | 67 | rv.data) |
| 68 | self.assertEqual(rv.status_code, 200) | 68 | self.assertEqual(rv.status_code, 200) |
| 69 | 69 | ||
diff --git a/test/test_api.py b/test/test_api.py index ad2525e..8be165e 100644 --- a/test/test_api.py +++ b/test/test_api.py | |||
| @@ -86,7 +86,7 @@ class Mat2APITestCase(unittest.TestCase): | |||
| 86 | self.assertEqual(request.status_code, 415) | 86 | self.assertEqual(request.status_code, 415) |
| 87 | 87 | ||
| 88 | error = request.get_json()['message'] | 88 | error = request.get_json()['message'] |
| 89 | self.assertEqual(error, 'The type application/pdf is not supported') | 89 | self.assertEqual(error, 'The filetype is not supported') |
| 90 | 90 | ||
| 91 | def test_api_supported_extensions(self): | 91 | def test_api_supported_extensions(self): |
| 92 | rv = self.app.get('/api/extension') | 92 | rv = self.app.get('/api/extension') |
| @@ -487,7 +487,7 @@ class Mat2APITestCase(unittest.TestCase): | |||
| 487 | ), | 487 | ), |
| 488 | follow_redirects=False | 488 | follow_redirects=False |
| 489 | ) | 489 | ) |
| 490 | self.assertEqual(r.get_json()['message'], 'The type None is not supported') | 490 | self.assertEqual(r.get_json()['message'], 'The filetype is not supported') |
| 491 | self.assertEqual(r.status_code, 415) | 491 | self.assertEqual(r.status_code, 415) |
| 492 | 492 | ||
| 493 | 493 | ||
