mirror of
https://github.com/beetbox/beets.git
synced 2026-03-29 17:55:43 +02:00
Fix test class structure: move DGSearchQueryTest after DGAlbumInfoTest
This commit is contained in:
parent
0d8d3bfadf
commit
809744e8f4
1 changed files with 35 additions and 35 deletions
|
|
@ -358,41 +358,6 @@ class DGAlbumInfoTest(BeetsTestCase):
|
|||
assert d is None
|
||||
assert "Release does not contain the required fields" in logs[0]
|
||||
|
||||
|
||||
@patch("beetsplug.discogs.DiscogsPlugin.setup", Mock())
|
||||
class DGSearchQueryTest(BeetsTestCase):
|
||||
def test_default_search_filters_without_extra_tags(self):
|
||||
"""Discogs search uses only the type filter when no extra_tags are set."""
|
||||
plugin = DiscogsPlugin()
|
||||
items = [Item()]
|
||||
|
||||
query, filters = plugin.get_search_query_with_filters(
|
||||
"album", items, "Artist", "Album", False
|
||||
)
|
||||
|
||||
assert "Album" in query
|
||||
assert filters == {"type": "release"}
|
||||
|
||||
def test_extra_tags_populate_discogs_filters(self):
|
||||
"""Configured extra_tags should populate Discogs search filters."""
|
||||
config["discogs"]["extra_tags"] = ["label", "catalognum"]
|
||||
plugin = DiscogsPlugin()
|
||||
|
||||
items = [
|
||||
Item(catalognum="ABC 123", label="abc"),
|
||||
Item(catalognum="ABC 123", label="abc"),
|
||||
Item(catalognum="ABC 123", label="def"),
|
||||
]
|
||||
|
||||
_query, filters = plugin.get_search_query_with_filters(
|
||||
"album", items, "Artist", "Album", False
|
||||
)
|
||||
|
||||
assert filters["type"] == "release"
|
||||
assert filters["label"] == "abc"
|
||||
# Catalog number should have whitespace removed.
|
||||
assert filters["catno"] == "ABC123"
|
||||
|
||||
def test_default_genre_style_settings(self):
|
||||
"""Test genre default settings, genres to genre, styles to style"""
|
||||
release = self._make_release_from_positions(["1", "2"])
|
||||
|
|
@ -502,6 +467,41 @@ class DGSearchQueryTest(BeetsTestCase):
|
|||
config["discogs"]["strip_disambiguation"] = True
|
||||
|
||||
|
||||
@patch("beetsplug.discogs.DiscogsPlugin.setup", Mock())
|
||||
class DGSearchQueryTest(BeetsTestCase):
|
||||
def test_default_search_filters_without_extra_tags(self):
|
||||
"""Discogs search uses only the type filter when no extra_tags are set."""
|
||||
plugin = DiscogsPlugin()
|
||||
items = [Item()]
|
||||
|
||||
query, filters = plugin.get_search_query_with_filters(
|
||||
"album", items, "Artist", "Album", False
|
||||
)
|
||||
|
||||
assert "Album" in query
|
||||
assert filters == {"type": "release"}
|
||||
|
||||
def test_extra_tags_populate_discogs_filters(self):
|
||||
"""Configured extra_tags should populate Discogs search filters."""
|
||||
config["discogs"]["extra_tags"] = ["label", "catalognum"]
|
||||
plugin = DiscogsPlugin()
|
||||
|
||||
items = [
|
||||
Item(catalognum="ABC 123", label="abc"),
|
||||
Item(catalognum="ABC 123", label="abc"),
|
||||
Item(catalognum="ABC 123", label="def"),
|
||||
]
|
||||
|
||||
_query, filters = plugin.get_search_query_with_filters(
|
||||
"album", items, "Artist", "Album", False
|
||||
)
|
||||
|
||||
assert filters["type"] == "release"
|
||||
assert filters["label"] == "abc"
|
||||
# Catalog number should have whitespace removed.
|
||||
assert filters["catno"] == "ABC123"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"track_artist_anv,track_artist,track_artists",
|
||||
[
|
||||
|
|
|
|||
Loading…
Reference in a new issue