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:
parent
53fe5921d2
commit
05e2566c35
3 changed files with 23 additions and 15 deletions
|
@ -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"],
|
||||
),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue