From f55588c08c20da6a2901c7f4cb4f1dd664b38849 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 21 Aug 2020 18:37:15 -0400 Subject: [PATCH] In web tests, allow mime-type to be either application/zip or application/x-zip-compressed --- tests/test_cli_web.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/test_cli_web.py b/tests/test_cli_web.py index 2e7d427b..6c2e14a3 100644 --- a/tests/test_cli_web.py +++ b/tests/test_cli_web.py @@ -93,7 +93,10 @@ class TestWeb: res = c.get("/download", headers=self._make_auth_headers(web.password)) res.get_data() assert res.status_code == 200 - assert res.mimetype == "application/zip" + assert ( + res.mimetype == "application/zip" + or res.mimetype == "application/x-zip-compressed" + ) def test_share_mode_autostop_sharing_on(self, temp_dir, common_obj, temp_file_1024): web = web_obj(temp_dir, common_obj, "share", 3) @@ -106,11 +109,16 @@ class TestWeb: res = c.get("/download", headers=self._make_auth_headers(web.password)) res.get_data() assert res.status_code == 200 - assert res.mimetype == "application/zip" + assert ( + res.mimetype == "application/zip" + or res.mimetype == "application/x-zip-compressed" + ) assert web.running == False - def test_share_mode_autostop_sharing_off(self, temp_dir, common_obj, temp_file_1024): + def test_share_mode_autostop_sharing_off( + self, temp_dir, common_obj, temp_file_1024 + ): web = web_obj(temp_dir, common_obj, "share", 3) web.settings.set("share", "autostop_sharing", False) @@ -121,7 +129,10 @@ class TestWeb: res = c.get("/download", headers=self._make_auth_headers(web.password)) res.get_data() assert res.status_code == 200 - assert res.mimetype == "application/zip" + assert ( + res.mimetype == "application/zip" + or res.mimetype == "application/x-zip-compressed" + ) assert web.running == True def test_receive_mode(self, temp_dir, common_obj):