diff options
| author | Ruin0x11 | 2021-05-09 01:29:36 -0700 |
|---|---|---|
| committer | Ruin0x11 | 2021-05-09 01:29:36 -0700 |
| commit | a2b68925ac3c1a7aa2d2e806abbdd8d48f4224f6 (patch) | |
| tree | 36ddf7b30ca19721283db86fd7bc9cac354283a8 /server/szurubooru/tests | |
| parent | ca771495979b035ac670b850b10239b6e4f10dcc (diff) | |
Support BMP format uploads
Diffstat (limited to 'server/szurubooru/tests')
| -rw-r--r-- | server/szurubooru/tests/assets/bmp.bmp | bin | 0 -> 30054 bytes | |||
| -rw-r--r-- | server/szurubooru/tests/func/test_mime.py | 4 | ||||
| -rw-r--r-- | server/szurubooru/tests/func/test_posts.py | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/server/szurubooru/tests/assets/bmp.bmp b/server/szurubooru/tests/assets/bmp.bmp Binary files differnew file mode 100644 index 0000000..3a18269 --- /dev/null +++ b/server/szurubooru/tests/assets/bmp.bmp diff --git a/server/szurubooru/tests/func/test_mime.py b/server/szurubooru/tests/func/test_mime.py index 0d8f645..62fd4a7 100644 --- a/server/szurubooru/tests/func/test_mime.py +++ b/server/szurubooru/tests/func/test_mime.py @@ -13,6 +13,7 @@ from szurubooru.func import mime ("jpeg.jpg", "image/jpeg"), ("gif.gif", "image/gif"), ("webp.webp", "image/webp"), + ("bmp.bmp", "image/bmp"), ("text.txt", "application/octet-stream"), ], ) @@ -34,6 +35,7 @@ def test_get_mime_type_for_empty_file(): ("image/jpeg", "jpg"), ("image/gif", "gif"), ("image/webp", "webp"), + ("image/bmp", "bmp"), ("application/octet-stream", "dat"), ], ) @@ -75,9 +77,11 @@ def test_is_video(input_mime_type, expected_state): ("image/gif", True), ("image/png", True), ("image/jpeg", True), + ("image/bmp", True), ("IMAGE/GIF", True), ("IMAGE/PNG", True), ("IMAGE/JPEG", True), + ("IMAGE/BMP", True), ("image/anything_else", False), ("not an image", False), ], diff --git a/server/szurubooru/tests/func/test_posts.py b/server/szurubooru/tests/func/test_posts.py index 6139555..0693741 100644 --- a/server/szurubooru/tests/func/test_posts.py +++ b/server/szurubooru/tests/func/test_posts.py @@ -394,6 +394,13 @@ def test_update_post_source_with_too_long_string(): ), ( False, + "bmp.bmp", + "image/bmp", + model.Post.TYPE_IMAGE, + "1_244c8840887984c4.bmp", + ), + ( + False, "gif-animated.gif", "image/gif", model.Post.TYPE_ANIMATION, |