mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-20 20:46:53 +00:00
Chore: remove unused is_file_ext_supported
Nothing in production called it, only its own test.
This commit is contained in:
1 parent
4610171a94
commit
1326378a90
2 files changed
-17
No files matched your search
@@ -44,17 +44,6 @@ def get_default_file_extension(mime_type: str) -> str:
|
||||
return ext if ext else ""
|
||||
|
||||
|
||||
def is_file_ext_supported(ext: str) -> bool:
|
||||
"""
|
||||
Returns True if the file extension is supported, False otherwise
|
||||
TODO: Investigate why this really exists, why not use mimetype
|
||||
"""
|
||||
if ext:
|
||||
return ext.lower() in get_supported_file_extensions()
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def get_supported_file_extensions() -> set[str]:
|
||||
extensions = set()
|
||||
for parser_class in get_parser_registry().all_parsers():
|
||||
|
||||
@@ -14,7 +14,6 @@ from documents.parsers import encode_thumbnail_webp
|
||||
from documents.parsers import get_default_file_extension
|
||||
from documents.parsers import get_default_thumbnail
|
||||
from documents.parsers import get_supported_file_extensions
|
||||
from documents.parsers import is_file_ext_supported
|
||||
from documents.parsers import make_thumbnail_from_pdf
|
||||
from documents.parsers import rasterize_pdf_page_to_png
|
||||
from paperless.parsers.registry import get_parser_registry
|
||||
@@ -132,11 +131,6 @@ class TestParserAvailability:
|
||||
# Test invalid mimetype returns no extension
|
||||
assert get_default_file_extension("aasdasd/dgfgf") == ""
|
||||
|
||||
def test_file_extension_support(self) -> None:
|
||||
assert is_file_ext_supported(".pdf")
|
||||
assert not is_file_ext_supported(".hsdfh")
|
||||
assert not is_file_ext_supported("")
|
||||
|
||||
|
||||
class TestComputeThumbnailDpi:
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in new issue
Block a user