From c0d8d6c8eb74d839e520cd2e4429763208b478dd Mon Sep 17 00:00:00 2001 From: Jfriedli Date: Tue, 23 Mar 2021 21:20:54 +0100 Subject: catch newly thrown ValueErrors on get_file_parser --- test/test.py | 2 +- test/test_api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test') 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): data=dict( file=(io.BytesIO(b""), 'test.pdf'), ), follow_redirects=True) - self.assertIn(b'The type application/pdf is not supported', + self.assertIn(b'The filetype is not supported', rv.data) self.assertEqual(rv.status_code, 200) 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): self.assertEqual(request.status_code, 415) error = request.get_json()['message'] - self.assertEqual(error, 'The type application/pdf is not supported') + self.assertEqual(error, 'The filetype is not supported') def test_api_supported_extensions(self): rv = self.app.get('/api/extension') @@ -487,7 +487,7 @@ class Mat2APITestCase(unittest.TestCase): ), follow_redirects=False ) - self.assertEqual(r.get_json()['message'], 'The type None is not supported') + self.assertEqual(r.get_json()['message'], 'The filetype is not supported') self.assertEqual(r.status_code, 415) -- cgit v1.3