Skip to content

Commit

Permalink
Merge branch 'main' into v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bpepple committed Mar 30, 2024
2 parents 4a6904d + aac716a commit d4e6f57
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.3
rev: v0.3.4
hooks:
- id: ruff
- id: ruff-format
4 changes: 2 additions & 2 deletions mokkari/schemas/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class CommonIssue(BaseModel):
id (int): The Metron identification number for the associated series.
number (str): The number of the issue.
cover_date (date): The cover date of the issue.
store_date (date): The store date of the issue.
image (HttpUrl): The url of the cover image for the issue.
cover_hash (str): The hash of the cover image for the issue.
modified (datetime): The modified date of the issue.
Expand All @@ -94,6 +95,7 @@ class CommonIssue(BaseModel):
id: int
number: str
cover_date: date
store_date: date | None = None
image: HttpUrl | None = None
cover_hash: str | None = None
modified: datetime
Expand Down Expand Up @@ -146,8 +148,6 @@ class Issue(CommonIssue):
series: IssueSeries
collection_title: str = Field(alias="title")
story_titles: list[str] = Field(alias="name")
cover_date: date
store_date: date | None = None
price: Decimal | None = None
rating: GenericItem
sku: str | None = None
Expand Down
4 changes: 2 additions & 2 deletions mokkari/schemas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ class CommonSeries(BaseModel):
id (int): The Metron identification number for the series.
year_began (int): The year the series began.
issue_count (int): The number of issues.
volume (int): The volume of the series.
modified (datetime): The date/time the series was last changed.
"""

id: int
year_began: int
issue_count: int
volume: int
modified: datetime


Expand All @@ -68,7 +70,6 @@ class Series(CommonSeries):
----------
name (str): The name of the series.
sort_name (str): The name used to determine the sort order for a series.
volume (int): The volume of the series.
series_type (GenericItem): The type of series.
publisher (GenericItem): The publisher of the series.
year_end (int): The year the series ended.
Expand All @@ -82,7 +83,6 @@ class Series(CommonSeries):

name: str
sort_name: str
volume: int
series_type: GenericItem
publisher: GenericItem
year_end: int | None = None
Expand Down
88 changes: 43 additions & 45 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tox = "^4.11.3"

[tool.poetry.group.test.dependencies]
coverage = { extras = ["toml"], version = "^7.0" }
pytest-cov = "^4.1.0"
pytest-cov = "^5.0.0"
requests-mock = "^1.9.3"

[tool.poetry.group.lint.dependencies]
Expand Down
6 changes: 4 additions & 2 deletions tests/test_arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ def test_arcs_list(talker: Session) -> None:
"""Test for ArcsList."""
arcs = talker.arcs_list()
arc_iter = iter(arcs)
assert next(arc_iter).name == '"Blue Beetle" Road Trip'
assert next(arc_iter).name == '"Bone" The Great Cow Race'
assert next(arc_iter).name == "'Til Death Do Us..."
assert next(arc_iter).name == "(She) Drunk History"
assert next(arc_iter).name == "1+2 = Fantastic Three"
assert next(arc_iter).name == "1602"
assert len(arcs) == 1418
assert arcs[3].name == "1602"
assert len(arcs) == 1498
assert arcs[5].name == "1602"


def test_arc_issue_list(talker: Session) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def test_character_list(talker: Session) -> None:
assert next(character_iter).name == "'Mazing Man"
assert next(character_iter).name == "3-D Man (Chandler)"
assert next(character_iter).name == "3-D Man (Garrett)"
assert len(chars) == 865
assert len(chars) == 907
assert chars[2].name == "3-D Man (Garrett)"


def test_character_issue_list(talker: Session) -> None:
"""Test for getting an issue list for an arc."""
issues = talker.character_issues_list(1)
assert len(issues) == 400
assert len(issues) == 403
assert issues[0].id == 258
assert issues[0].issue_name == "Fantastic Four (1961) #45"
assert issues[0].cover_date == date(1965, 12, 1)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ def test_known_creator(talker: Session) -> None:
assert jack.resource_url.__str__() == "https://metron.cloud/creator/jack-kirby/"


def test_comic_list(talker: Session) -> None:
def test_creator_list(talker: Session) -> None:
"""Test the CreatorsList."""
creators = talker.creators_list({"name": "man"})
creator_iter = iter(creators)
assert next(creator_iter).name == "A. J. Lieberman"
assert next(creator_iter).name == "Abel Laxamana"
assert next(creator_iter).name == "Adam Freeman"
assert next(creator_iter).name == "Adam Schlagman"
assert len(creators) == 338
assert len(creators) == 352
assert creators[3].name == "Adam Schlagman"


Expand Down
2 changes: 1 addition & 1 deletion tests/test_publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_publisher_list(talker: Session) -> None:
assert next(publisher_iter).name == "12-Gauge Comics"
assert next(publisher_iter).name == "AAA Pop Comics"
assert next(publisher_iter).name == "AWA Studios"
assert len(publishers) == 93
assert len(publishers) == 103
assert publishers[2].name == "AWA Studios"


Expand Down
12 changes: 8 additions & 4 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ def test_series_list(talker: Session) -> None:
assert next(series_iter).id == 5959
assert next(series_iter).id == 2481
assert next(series_iter).id == 763
assert next(series_iter).id == 93
assert len(series) == 219
assert series[4].id == 93
assert series[4].display_name == "Batman (2016)"
assert next(series_iter).id == 7133
assert len(series) == 230
assert series[3].id == 763
assert series[3].volume == 2
assert series[3].issue_count == 57
assert series[4].id == 7133
assert series[4].display_name == "Batman HC (2012)"
assert series[4].volume == 1


def test_bad_series(talker: Session) -> None:
Expand Down
7 changes: 4 additions & 3 deletions tests/test_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ def test_team_list(talker: Session) -> None:
teams = talker.teams_list()
team_iter = iter(teams)
assert next(team_iter).name == "501st Legion"
assert next(team_iter).name == "5th Dimensional Imps"
assert next(team_iter).name == "A-Force"
assert next(team_iter).name == "A-Next"
assert next(team_iter).name == "A.I.M."
assert len(teams) == 1331
assert teams[3].name == "A.I.M."
assert len(teams) == 1399
assert teams[4].name == "A.I.M."


def test_team_issue_list(talker: Session) -> None:
"""Test for getting an issue list for an arc."""
issues = talker.team_issues_list(1)
assert len(issues) == 609
assert len(issues) == 611
assert issues[0].id == 258
assert issues[0].issue_name == "Fantastic Four (1961) #45"
assert issues[0].cover_date == date(1965, 12, 1)
Expand Down
Binary file modified tests/testing_mock.sqlite
Binary file not shown.

0 comments on commit d4e6f57

Please sign in to comment.