2022-07-11 16:10:31 -07:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
import comicapi.genericmetadata
|
|
|
|
from comicapi import utils
|
|
|
|
|
|
|
|
search_results = [
|
2023-08-05 03:02:12 -07:00
|
|
|
dict(
|
2022-07-11 16:10:31 -07:00
|
|
|
count_of_issues=1,
|
2023-05-12 13:48:45 -07:00
|
|
|
count_of_volumes=1,
|
2022-07-11 16:10:31 -07:00
|
|
|
description="this is a description",
|
2022-12-23 00:09:19 -08:00
|
|
|
id="1",
|
2022-10-23 14:40:15 -07:00
|
|
|
image_url="https://test.org/image/1",
|
2022-07-11 16:10:31 -07:00
|
|
|
name="test",
|
2022-10-05 16:34:32 -07:00
|
|
|
publisher="test",
|
2022-10-15 15:20:50 -07:00
|
|
|
start_year=0,
|
2022-11-03 16:32:35 -07:00
|
|
|
aliases=[],
|
2023-05-22 16:27:58 -07:00
|
|
|
format=None,
|
2022-07-11 16:10:31 -07:00
|
|
|
),
|
2023-08-05 03:02:12 -07:00
|
|
|
dict(
|
2022-07-11 16:10:31 -07:00
|
|
|
count_of_issues=1,
|
2023-05-12 13:48:45 -07:00
|
|
|
count_of_volumes=1,
|
2022-07-11 16:10:31 -07:00
|
|
|
description="this is a description",
|
2022-12-23 00:09:19 -08:00
|
|
|
id="2",
|
2022-10-23 14:40:15 -07:00
|
|
|
image_url="https://test.org/image/2",
|
2022-07-11 16:10:31 -07:00
|
|
|
name="test 2",
|
2022-10-05 16:34:32 -07:00
|
|
|
publisher="test",
|
2022-10-15 15:20:50 -07:00
|
|
|
start_year=0,
|
2022-11-03 16:32:35 -07:00
|
|
|
aliases=[],
|
2023-05-22 16:27:58 -07:00
|
|
|
format=None,
|
2022-07-11 16:10:31 -07:00
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
alt_covers = [
|
|
|
|
{"issue_id": 1, "url_list": ["https://test.org/image/1"]},
|
|
|
|
{"issue_id": 2, "url_list": ["https://test.org/image/2"]},
|
|
|
|
]
|
|
|
|
|
|
|
|
select_details = [
|
|
|
|
{
|
|
|
|
"issue_id": 1,
|
|
|
|
"image_url": "https://test.org/image/1",
|
|
|
|
"thumb_image_url": "https://test.org/thumb/1",
|
|
|
|
"cover_date": "1998",
|
|
|
|
"site_detail_url": "https://test.org/1",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"issue_id": 2,
|
|
|
|
"image_url": "https://test.org/image/2",
|
|
|
|
"thumb_image_url": "https://test.org/thumb/2",
|
|
|
|
"cover_date": "1998",
|
|
|
|
"site_detail_url": "https://test.org/2",
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
# Used to test GenericMetadata.overlay
|
|
|
|
metadata = [
|
|
|
|
(
|
|
|
|
comicapi.genericmetadata.GenericMetadata(series="test", issue="2", title="never"),
|
2022-07-18 09:00:56 -07:00
|
|
|
comicapi.genericmetadata.md_test.replace(series="test", issue="2", title="never"),
|
2022-07-11 16:10:31 -07:00
|
|
|
),
|
2022-07-18 09:00:56 -07:00
|
|
|
(
|
|
|
|
comicapi.genericmetadata.GenericMetadata(),
|
|
|
|
comicapi.genericmetadata.md_test.copy(),
|
2022-07-11 16:10:31 -07:00
|
|
|
),
|
2022-07-18 09:00:56 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
metadata_keys = [
|
2022-07-11 16:10:31 -07:00
|
|
|
(
|
2024-02-24 18:30:41 -08:00
|
|
|
comicapi.genericmetadata.md_test,
|
2022-07-18 09:00:56 -07:00
|
|
|
{
|
|
|
|
"issue_count": 6,
|
|
|
|
"issue_number": "1",
|
|
|
|
"month": 10,
|
|
|
|
"series": "Cory Doctorow's Futuristic Tales of the Here and Now",
|
|
|
|
"year": 2007,
|
2024-02-24 18:30:41 -08:00
|
|
|
"alternate_count": 7,
|
|
|
|
"alternate_number": "2",
|
|
|
|
"imprint": "craphound.com",
|
|
|
|
"publisher": "IDW Publishing",
|
2022-07-18 09:00:56 -07:00
|
|
|
},
|
2022-07-11 16:10:31 -07:00
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
credits = [
|
2022-07-27 23:24:34 -07:00
|
|
|
(comicapi.genericmetadata.md_test, "writer", "Dara Naraghi"),
|
|
|
|
(comicapi.genericmetadata.md_test, "writeR", "Dara Naraghi"),
|
|
|
|
(
|
|
|
|
comicapi.genericmetadata.md_test.replace(
|
|
|
|
credits=[{"person": "Dara Naraghi", "role": "writer"}, {"person": "Dara Naraghi", "role": "writer"}]
|
|
|
|
),
|
|
|
|
"writeR",
|
|
|
|
"Dara Naraghi",
|
|
|
|
),
|
2022-07-11 16:10:31 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
imprints = [
|
|
|
|
("marvel", ("", "Marvel")),
|
|
|
|
("marvel comics", ("", "Marvel")),
|
|
|
|
("aircel", ("Aircel Comics", "Marvel")),
|
2022-08-08 18:03:29 -07:00
|
|
|
("nothing", ("", "nothing")),
|
2022-07-11 16:10:31 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
additional_imprints = [
|
|
|
|
("test", ("Test", "Marvel")),
|
|
|
|
("temp", ("Temp", "DC Comics")),
|
|
|
|
]
|
|
|
|
|
|
|
|
all_imprints = imprints + additional_imprints
|
|
|
|
|
|
|
|
seed_imprints = {
|
2023-02-04 15:02:21 -08:00
|
|
|
"Marvel": utils.ImprintDict("Marvel", {"marvel comics": "", "aircel": "Aircel Comics"}),
|
2022-07-11 16:10:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
additional_seed_imprints = {
|
|
|
|
"Marvel": utils.ImprintDict("Marvel", {"test": "Test"}),
|
|
|
|
"DC Comics": utils.ImprintDict("DC Comics", {"temp": "Temp"}),
|
|
|
|
}
|
|
|
|
|
|
|
|
all_seed_imprints = {
|
|
|
|
"Marvel": seed_imprints["Marvel"].copy(),
|
|
|
|
"DC Comics": additional_seed_imprints["DC Comics"].copy(),
|
|
|
|
}
|
|
|
|
all_seed_imprints["Marvel"].update(additional_seed_imprints["Marvel"])
|
|
|
|
|
|
|
|
conflicting_seed_imprints = {"Marvel": {"test": "Never"}}
|
2024-04-28 13:53:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
metadata_prepared = (
|
|
|
|
(
|
|
|
|
(comicapi.genericmetadata.GenericMetadata(), comicapi.genericmetadata.GenericMetadata()),
|
|
|
|
comicapi.genericmetadata.GenericMetadata(notes="Tagged with ComicTagger 1.3.2a5 on 2022-04-16 15:52:26."),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
(comicapi.genericmetadata.GenericMetadata(issue_id="123"), comicapi.genericmetadata.GenericMetadata()),
|
|
|
|
comicapi.genericmetadata.GenericMetadata(
|
|
|
|
issue_id="123", notes="Tagged with ComicTagger 1.3.2a5 on 2022-04-16 15:52:26. [Issue ID 123]"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
(
|
|
|
|
comicapi.genericmetadata.GenericMetadata(
|
|
|
|
issue_id="123", tag_origin=comicapi.genericmetadata.TagOrigin("SOURCE", "Source")
|
|
|
|
),
|
|
|
|
comicapi.genericmetadata.GenericMetadata(),
|
|
|
|
),
|
|
|
|
comicapi.genericmetadata.GenericMetadata(
|
|
|
|
issue_id="123",
|
|
|
|
tag_origin=comicapi.genericmetadata.TagOrigin("SOURCE", "Source"),
|
|
|
|
notes="Tagged with ComicTagger 1.3.2a5 using info from Source on 2022-04-16 15:52:26. [Issue ID 123]",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|