mirror of
https://github.com/beetbox/beets.git
synced 2026-03-26 07:15:34 +01:00
Add test for original_date
This commit is contained in:
parent
80fc1490e5
commit
8a586ec506
1 changed files with 24 additions and 1 deletions
|
|
@ -45,11 +45,17 @@ def test_genre_deprecation(genre, expected_genres):
|
|||
|
||||
|
||||
class ApplyTest(BeetsTestCase):
|
||||
def _apply(self, per_disc_numbering=False, artist_credit=False):
|
||||
def _apply(
|
||||
self,
|
||||
per_disc_numbering=False,
|
||||
artist_credit=False,
|
||||
original_date=False,
|
||||
):
|
||||
info = self.info
|
||||
mapping = dict(zip(self.items, info.tracks))
|
||||
self.config["per_disc_numbering"] = per_disc_numbering
|
||||
self.config["artist_credit"] = artist_credit
|
||||
self.config["original_date"] = original_date
|
||||
amatch = AlbumMatch(0, self.info, mapping)
|
||||
amatch.apply_metadata()
|
||||
|
||||
|
|
@ -216,6 +222,23 @@ class ApplyTest(BeetsTestCase):
|
|||
assert self.items[0].month == 2
|
||||
assert self.items[0].day == 3
|
||||
|
||||
def test_original_date_overrides_release_date(self):
|
||||
self.items = [Item(year=1, month=2, day=3)]
|
||||
self.info.update(
|
||||
year=2013,
|
||||
month=12,
|
||||
day=18,
|
||||
original_year=1999,
|
||||
original_month=4,
|
||||
original_day=7,
|
||||
)
|
||||
|
||||
self._apply(original_date=True)
|
||||
|
||||
assert self.items[0].year == 1999
|
||||
assert self.items[0].month == 4
|
||||
assert self.items[0].day == 7
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"overwrite_fields,expected_item_artist",
|
||||
|
|
|
|||
Loading…
Reference in a new issue