From d1611113424737a976dcbfafe401b193f0140032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Wed, 16 Oct 2024 12:33:17 +0100 Subject: [PATCH] test helpers: remove redundant _get_item_count It always returns 1. --- beets/test/helper.py | 11 ++--------- test/plugins/test_aura.py | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/beets/test/helper.py b/beets/test/helper.py index 322921fb5..b919e1c2c 100644 --- a/beets/test/helper.py +++ b/beets/test/helper.py @@ -246,16 +246,15 @@ class TestHelper(_common.Assertions): The item is attached to the database from `self.lib`. """ - item_count = self._get_item_count() values_ = { "title": "t\u00eftle {0}", "artist": "the \u00e4rtist", "album": "the \u00e4lbum", - "track": item_count, + "track": 1, "format": "MP3", } values_.update(values) - values_["title"] = values_["title"].format(item_count) + values_["title"] = values_["title"].format(1) values_["db"] = self.lib item = Item(**values_) if "path" not in values: @@ -372,12 +371,6 @@ class TestHelper(_common.Assertions): return path - def _get_item_count(self): - if not hasattr(self, "__item_count"): - count = 0 - self.__item_count = count + 1 - return count - # Running beets commands def run_command(self, *args, **kwargs): diff --git a/test/plugins/test_aura.py b/test/plugins/test_aura.py index c0a76b1c5..25a730cab 100644 --- a/test/plugins/test_aura.py +++ b/test/plugins/test_aura.py @@ -91,6 +91,7 @@ class TestAuraResponse: "artist": item.artist, "size": Path(os.fsdecode(item.path)).stat().st_size, "title": item.title, + "track": 1, }, "relationships": { "albums": {"data": [{"id": str(album.id), "type": "album"}]},