Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
s0hv committed Oct 26, 2023
1 parent 73dbd03 commit c85e166
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tests/scrapers/mangaplus/test_mangaplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

from src.db.models.chapter import Chapter
from src.db.models.manga import MangaServiceWithId
from src.scrapers.mangaplus.mangaplus import MangaPlus
from src.scrapers.mangaplus.mangaplus import (MangaPlus, ResponseWrapper,
TitleDetailViewWrapper)
from src.scrapers.mangaplus.protobuf import mangaplus_pb2
from src.tests.testing_utils import BaseTestClasses, spy_on
from src.utils.utilities import utcfromtimestamp, utcnow
Expand All @@ -36,6 +37,7 @@ class TestMangaPlusParser(BaseTestClasses.DatabaseTestCase):
request_data_oneshot: bytes
request_data_notfound: bytes
request_data_award: bytes
request_data_hiatus: bytes
request_data_all: bytes

@staticmethod
Expand Down Expand Up @@ -264,12 +266,18 @@ def test_parsing(self):
resp = self.mangaplus.parse_series(title_id)
self.assertEqual(len(responses.calls), 1)

self.assertIsNotNone(resp)
resp = cast(ResponseWrapper, resp)

self.assertIsNone(resp.error_result)
self.assertIsNone(resp.all_titles_view)
self.assertIsNotNone(resp.success_result)
self.assertIsNotNone(resp.title_detail_view)

detail = resp.title_detail_view
self.assertIsNotNone(detail)
detail = cast(TitleDetailViewWrapper, detail)

UpdateTiming = mangaplus_pb2.TitleDetailView.UpdateTiming
self.assertEqual(detail.release_schedule, mangaplus_pb2.TitleLabels.ReleaseSchedule.WEEKLY)
self.assertIsNone(detail.next_timestamp)
Expand Down

0 comments on commit c85e166

Please sign in to comment.