Skip to content

Commit

Permalink
fix failing tests (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbull committed Dec 4, 2022
1 parent 96759b0 commit 31f93ac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_client.py
Expand Up @@ -56,7 +56,10 @@ def test_content_type_setting(rig, tmpdir):
mimes = [
(".css", "text/css"),
(".html", "text/html"),
(".js", "application/javascript"),
(
".js",
["application/javascript", "text/javascript"],
), # JS type can be different on different platforms
(".mp3", "audio/mpeg"),
(".mp4", "video/mp4"),
(".jpeg", "image/jpeg"),
Expand All @@ -74,7 +77,10 @@ def _test_write_content_type(suffix, expected, rig_ref, check=True):
meta = cp.client._get_metadata(cp)

if check:
assert meta["content_type"] == expected
if isinstance(expected, list):
assert meta["content_type"] in expected
else:
assert meta["content_type"] == expected

# should guess by default
for suffix, content_type in mimes:
Expand Down

0 comments on commit 31f93ac

Please sign in to comment.