Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests #297

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
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