Fix tests for comicvinetalker
This commit is contained in:
parent
62bf1d3808
commit
685ce014b6
@ -160,7 +160,8 @@ date = comictaggerlib.comicvinetalker.ComicVineTalker().parse_date_str(cv_issue_
|
||||
|
||||
cv_md = comicapi.genericmetadata.GenericMetadata(
|
||||
is_empty=False,
|
||||
tag_origin=None,
|
||||
tag_origin="Comic Vine",
|
||||
issue_id=cv_issue_result["results"]["id"],
|
||||
series=cv_issue_result["results"]["volume"]["name"],
|
||||
issue=cv_issue_result["results"]["issue_number"],
|
||||
title=cv_issue_result["results"]["name"],
|
||||
@ -182,7 +183,7 @@ cv_md = comicapi.genericmetadata.GenericMetadata(
|
||||
alternate_number=None,
|
||||
alternate_count=None,
|
||||
imprint=None,
|
||||
notes="Tagged with ComicTagger 1.4.4a9.dev20 using info from Comic Vine on 2022-07-11 17:42:41. [Issue ID 140529]",
|
||||
notes=None,
|
||||
web_link=cv_issue_result["results"]["site_detail_url"],
|
||||
format=None,
|
||||
manga=None,
|
||||
|
@ -39,7 +39,7 @@ def test_fetch_issues_by_volume(comicvine_api, comic_cache):
|
||||
assert results == cache_issues
|
||||
|
||||
|
||||
def test_fetch_issue_data_by_issue_id(comicvine_api, settings, mock_now, mock_version):
|
||||
def test_fetch_issue_data_by_issue_id(comicvine_api, settings, mock_version):
|
||||
ct = comictaggerlib.comicvinetalker.ComicVineTalker()
|
||||
result = ct.fetch_issue_data_by_issue_id(140529, settings)
|
||||
assert result == testing.comicvine.cv_md
|
||||
@ -65,13 +65,13 @@ cv_issue = [
|
||||
|
||||
|
||||
@pytest.mark.parametrize("volume_id, issue_number, expected", cv_issue)
|
||||
def test_fetch_issue_data(comicvine_api, settings, mock_now, mock_version, volume_id, issue_number, expected):
|
||||
def test_fetch_issue_data(comicvine_api, settings, mock_version, volume_id, issue_number, expected):
|
||||
ct = comictaggerlib.comicvinetalker.ComicVineTalker()
|
||||
results = ct.fetch_issue_data(volume_id, issue_number, settings)
|
||||
assert results == expected
|
||||
|
||||
|
||||
def test_fetch_issue_select_details(comicvine_api, mock_now, mock_version):
|
||||
def test_fetch_issue_select_details(comicvine_api, mock_version):
|
||||
ct = comictaggerlib.comicvinetalker.ComicVineTalker()
|
||||
result = ct.fetch_issue_select_details(140529)
|
||||
expected = {
|
||||
|
@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import datetime
|
||||
import io
|
||||
import shutil
|
||||
import unittest.mock
|
||||
@ -115,18 +114,6 @@ def comicvine_api(monkeypatch, cbz, comic_cache) -> unittest.mock.Mock:
|
||||
return m_get
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_now(monkeypatch):
|
||||
class mydatetime:
|
||||
time = datetime.datetime(2022, 7, 11, 17, 42, 41)
|
||||
|
||||
@classmethod
|
||||
def now(cls):
|
||||
return cls.time
|
||||
|
||||
monkeypatch.setattr(comictaggerlib.comicvinetalker, "datetime", mydatetime)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_version(monkeypatch):
|
||||
version = "1.4.4a9.dev20"
|
||||
|
Loading…
Reference in New Issue
Block a user