diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-04-04 23:23:33 +1000 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-04-04 23:23:33 +1000 |
commit | d384417aab37db37fc34d6463870fd5b9727dc75 (patch) | |
tree | b9c3a92d924622a65ed738c3ec69af89729b88f0 /mediagoblin/tests/test_api.py | |
parent | d5720a050749d7b3fa28846bbd4ece9df5e1bfb6 (diff) | |
download | mediagoblin-d384417aab37db37fc34d6463870fd5b9727dc75.tar.lz mediagoblin-d384417aab37db37fc34d6463870fd5b9727dc75.tar.xz mediagoblin-d384417aab37db37fc34d6463870fd5b9727dc75.zip |
Fix tests on Debian 11.
Diffstat (limited to 'mediagoblin/tests/test_api.py')
-rw-r--r-- | mediagoblin/tests/test_api.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_api.py b/mediagoblin/tests/test_api.py index 23548f23..5f688857 100644 --- a/mediagoblin/tests/test_api.py +++ b/mediagoblin/tests/test_api.py @@ -131,8 +131,17 @@ class TestAPI: # Check that we got the response we're expecting response, data = self._post_image_to_feed(test_app, image) assert response.status_code == 200 - assert data["object"]["fullImage"]["url"].endswith("unknown.jpe") - assert data["object"]["image"]["url"].endswith("unknown.thumbnail.jpe") + # mimetypes.guess_all_extensions gives a different result depending on Python version: + # .jpe on Debian 10 + # .jfif on Debian 11 + assert ( + data["object"]["fullImage"]["url"].endswith("unknown.jpe") + or data["object"]["fullImage"]["url"].endswith("unknown.jfif") + ) + assert ( + data["object"]["image"]["url"].endswith("unknown.thumbnail.jpe") + or data["object"]["image"]["url"].endswith("unknown.thumbnail.jfif") + ) def test_can_post_image_custom_filename(self, test_app): """ Tests an image can be posted to the API with custom filename """ |