1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 21:45:25 +02:00

fix: recipe scraper image cleaning (#2139)

* updated image cleaner
enabled image cleaner
added case for nested image dicts

* refactored image cleaner to return a list of urls
This commit is contained in:
Michael Genson 2023-02-19 18:43:52 -06:00 committed by GitHub
parent 53fe5921d2
commit 05e2566c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 15 deletions

View file

@ -73,22 +73,27 @@ image_cleaner_test_cases = (
CleanerCase(
test_id="empty_string",
input="",
expected="no image",
expected=["no image"],
),
CleanerCase(
test_id="no_change",
input="https://example.com/image.jpg",
expected="https://example.com/image.jpg",
expected=["https://example.com/image.jpg"],
),
CleanerCase(
test_id="dict with url key",
input={"url": "https://example.com/image.jpg"},
expected="https://example.com/image.jpg",
expected=["https://example.com/image.jpg"],
),
CleanerCase(
test_id="list of strings",
input=["https://example.com/image.jpg"],
expected="https://example.com/image.jpg",
expected=["https://example.com/image.jpg"],
),
CleanerCase(
test_id="list of dicts with url key",
input=[{"url": "https://example.com/image.jpg"}],
expected=["https://example.com/image.jpg"],
),
)