mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-08 03:18:28 +03:00
Move Makefile and fix import error with unused import.
This commit is contained in:
@@ -92,4 +92,21 @@ def test_really_long_name(storage_base, dummy_file):
|
||||
url = f"https://example.com/{'file'*100}"
|
||||
media = Media(filename=dummy_file)
|
||||
storage.set_key(media, url, Metadata())
|
||||
assert media.key == f"https-example-com-{'file'*13}/6ae8a75555209fd6c44157c0.txt"
|
||||
assert media.key == f"https-example-com-{'file'*13}/6ae8a75555209fd6c44157c0.txt"
|
||||
|
||||
|
||||
def test_storage_loads_hash_enricher(storage_base, dummy_file):
|
||||
"""Ensure 'hash_enricher' is properly loaded without an explicit import."""
|
||||
config = {"path_generator": "url", "filename_generator": "static"}
|
||||
storage = storage_base(config)
|
||||
|
||||
url = "https://example.com/file/"
|
||||
media = Media(filename=dummy_file)
|
||||
metadata = Metadata()
|
||||
|
||||
try:
|
||||
storage.set_key(media, url, metadata)
|
||||
except Exception as e:
|
||||
pytest.fail(f"Storage failed to dynamically load hash_enricher: {e}")
|
||||
|
||||
assert media.key is not None, "Expected media.key to be set, but it was None"
|
||||
|
||||
Reference in New Issue
Block a user