Skip to content

Commit

Permalink
Add Status field to Series Schema (#58)
Browse files Browse the repository at this point in the history
* Add `status` to Series schema.
* Refresh test data & update tests
* Update project deps
  • Loading branch information
bpepple authored Jul 22, 2024
1 parent 4691654 commit 84c924d
Show file tree
Hide file tree
Showing 10 changed files with 245 additions and 228 deletions.
2 changes: 2 additions & 0 deletions mokkari/schemas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Series(CommonSeries):
name (str): The name of the series.
sort_name (str): The name used to determine the sort order for a series.
series_type (GenericItem): The type of series.
status (str): The status of the series.
publisher (GenericItem): The publisher of the series.
year_end (int): The year the series ended.
desc (str): The description of the series.
Expand All @@ -84,6 +85,7 @@ class Series(CommonSeries):
name: str
sort_name: str
series_type: GenericItem
status: str
publisher: GenericItem
year_end: int | None = None
desc: str
Expand Down
419 changes: 216 additions & 203 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/test_arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_arcs_list(talker: Session) -> None:
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) == 1498
assert len(arcs) == 1813
assert arcs[5].name == "1602"


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) == 907
assert len(chars) == 975
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) == 403
assert len(issues) == 412
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
2 changes: 1 addition & 1 deletion tests/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_creator_list(talker: Session) -> None:
assert next(creator_iter).name == "Abel Laxamana"
assert next(creator_iter).name == "Adam Freeman"
assert next(creator_iter).name == "Adam Schlagman"
assert len(creators) == 352
assert len(creators) == 377
assert creators[3].name == "Adam Schlagman"


Expand Down
16 changes: 8 additions & 8 deletions tests/test_publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def test_known_publishers(talker: Session) -> None:
)
assert marvel.founded == 1939
assert marvel.modified == datetime(
2019,
6,
23,
15,
13,
23,
591390,
2024,
4,
7,
4,
53,
45,
729670,
tzinfo=timezone(timedelta(days=-1, seconds=72000), "-0400"),
)
assert marvel.resource_url.__str__() == "https://metron.cloud/publisher/marvel/"
Expand All @@ -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) == 103
assert len(publishers) == 110
assert publishers[2].name == "AWA Studios"


Expand Down
18 changes: 10 additions & 8 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def test_known_series(talker: Session) -> None:
assert death.year_end == 2018
assert death.issue_count == 5
assert death.series_type.name == "Limited Series"
assert death.status == "Completed"
assert death.publisher.id == 1
assert death.publisher.name == "Marvel"
assert death.modified == datetime(
Expand Down Expand Up @@ -53,6 +54,7 @@ def test_series_without_year_end(talker: Session) -> None:
assert abs_carnage.publisher.id == 1
assert abs_carnage.publisher.name == "Marvel"
assert abs_carnage.series_type.name == "Limited Series"
assert abs_carnage.status == "Completed"


def test_series_list(talker: Session) -> None:
Expand All @@ -61,16 +63,16 @@ def test_series_list(talker: Session) -> None:
series_iter = iter(series)
assert next(series_iter).id == 2547
assert next(series_iter).id == 5959
assert next(series_iter).id == 7972
assert next(series_iter).id == 2481
assert next(series_iter).id == 763
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
assert len(series) == 245
assert series[3].id == 2481
assert series[3].volume == 1
assert series[3].issue_count == 715
assert series[4].id == 763
assert series[4].display_name == "Batman (2011)"
assert series[4].volume == 2


def test_bad_series(talker: Session) -> None:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_series_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_series_type_list(talker: Session) -> None:
"""Test the SeriesTypeList."""
series_types = talker.series_type_list()
st_iter = iter(series_types)
assert next(st_iter).name == "Annual Series"
assert next(st_iter).name == "Cancelled Series"
assert next(st_iter).name == "Annual"
assert next(st_iter).name == "Digital Chapters"
assert series_types[3].name == "Hard Cover"
assert len(series_types) == 8
assert len(series_types) == 9
4 changes: 2 additions & 2 deletions tests/test_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def test_team_list(talker: Session) -> None:
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) == 1399
assert len(teams) == 1534
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) == 611
assert len(issues) == 618
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 84c924d

Please sign in to comment.