Update the comicvine_api fixture in conftest.py to actually return the comicvinetalker.
This commit is contained in:
parent
9aa29f1445
commit
34163fe9d7
@ -556,6 +556,7 @@ class ComicVineTalker(TalkerBase):
|
||||
# Get issue or volume information
|
||||
def fetch_comic_data(self, series_id: int, issue_number: str = "") -> GenericMetadata:
|
||||
comic_data = GenericMetadata()
|
||||
# TODO remove has_issues check? Enables testing. Possibly add source option to only get volume info?
|
||||
if self.source_details.static_options.has_issues and issue_number:
|
||||
comic_data = self.fetch_issue_data(series_id, issue_number)
|
||||
else:
|
||||
|
@ -56,7 +56,7 @@ def no_requests(monkeypatch) -> None:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def comicvine_api(monkeypatch, cbz, comic_cache) -> unittest.mock.Mock:
|
||||
def comicvine_api(monkeypatch, cbz, comic_cache) -> comictalker.talkers.comicvine.ComicVineTalker:
|
||||
# Any arguments may be passed and mock_get() will always return our
|
||||
# mocked object, which only has the .json() method or None for invalid urls.
|
||||
|
||||
@ -113,7 +113,10 @@ def comicvine_api(monkeypatch, cbz, comic_cache) -> unittest.mock.Mock:
|
||||
|
||||
# apply the monkeypatch for requests.get to mock_get
|
||||
monkeypatch.setattr(requests, "get", m_get)
|
||||
return m_get
|
||||
|
||||
cv = comictalker.talkers.comicvine.ComicVineTalker()
|
||||
cv.static_options = cv.source_details.static_options
|
||||
return cv
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -5,7 +5,6 @@ import pytest
|
||||
import comicapi.comicarchive
|
||||
import comicapi.issuestring
|
||||
import comictaggerlib.issueidentifier
|
||||
import comictalker.comictalker
|
||||
import testing.comicdata
|
||||
import testing.comicvine
|
||||
|
||||
@ -51,7 +50,7 @@ def test_get_issue_cover_match_score(cbz, settings, comicvine_api):
|
||||
|
||||
|
||||
def test_search(cbz, settings, comicvine_api):
|
||||
ii = comictaggerlib.issueidentifier.IssueIdentifier(cbz, settings, comictalker.comictalker.ComicTalker("comicvine"))
|
||||
ii = comictaggerlib.issueidentifier.IssueIdentifier(cbz, settings, comicvine_api)
|
||||
results = ii.search()
|
||||
cv_expected = {
|
||||
"series": f"{testing.comicvine.cv_volume_result['results']['name']} ({testing.comicvine.cv_volume_result['results']['start_year']})",
|
||||
|
Loading…
x
Reference in New Issue
Block a user