In web tests, allow mime-type to be either application/zip or application/x-zip-compressed

This commit is contained in:
Micah Lee 2020-08-21 18:37:15 -04:00
parent cf61f3ba43
commit f55588c08c
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -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):