Skip to content

Commit 50c842e

Browse files
author
Sara Safavi
committed
mimetypes.guess_extension() returns either .tif or .tiff - test accordingly
prior to Python 3.6, the order of extensions returned is nondeterministic, at Python 3.6+ ".tif" is always returned first. Until we drop Python 2.7 support, we need to account for all cases in our tests.
1 parent 6e8e7f5 commit 50c842e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_get_filename_from_url(url, expected):
148148

149149
@pytest.mark.parametrize('content_type,check', [
150150
(None, lambda x: re.match(r'^planet-[a-z0-9]{8}$', x, re.I) is not None),
151-
('image/tiff', lambda x: x.endswith('.tif')),
151+
('image/tiff', lambda x: x.endswith(('.tif', '.tiff'))),
152152
])
153153
def test_get_random_filename(content_type, check):
154154
assert check(utils.get_random_filename(content_type))

0 commit comments

Comments
 (0)