mirror of
https://github.com/beetbox/beets.git
synced 2026-03-28 00:06:51 +01:00
CI: skip discogs tests when discogs_client missing, guard empty items, reset config in test
This commit is contained in:
parent
99eec9ec25
commit
04e5d0083d
2 changed files with 6 additions and 0 deletions
|
|
@ -287,6 +287,9 @@ class DiscogsPlugin(SearchApiMetadataSourcePlugin[IDResponse]):
|
|||
|
||||
filters: dict[str, str] = {"type": "release"}
|
||||
|
||||
if not items:
|
||||
return query, filters
|
||||
|
||||
for tag, api_field in self.extra_discogs_field_by_tag.items():
|
||||
# The Discogs search API does not provide direct equivalents for
|
||||
# MusicBrainz "alias" or "tracks" search fields, so we ignore
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ from unittest.mock import Mock, patch
|
|||
|
||||
import pytest
|
||||
|
||||
pytest.importorskip("discogs_client", reason="discogs optional dependency not installed")
|
||||
|
||||
from beets import config
|
||||
from beets.library import Item
|
||||
from beets.test._common import Bag
|
||||
|
|
@ -500,6 +502,7 @@ class DGSearchQueryTest(BeetsTestCase):
|
|||
assert filters["label"] == "abc"
|
||||
# Catalog number should have whitespace removed.
|
||||
assert filters["catno"] == "ABC123"
|
||||
config["discogs"]["extra_tags"] = []
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Reference in a new issue