mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 03:52:51 +01:00
Fix tests for albums from manual ID
This commit is contained in:
parent
f17e8550ca
commit
ad66b8796a
2 changed files with 16 additions and 22 deletions
|
|
@ -277,6 +277,22 @@ class MBAlbumInfoTest(unittest.TestCase):
|
|||
self.assertEqual(track.artist_sort, 'TRACK ARTIST SORT NAME')
|
||||
self.assertEqual(track.artist_credit, 'TRACK ARTIST CREDIT')
|
||||
|
||||
def test_album_for_id_correct(self):
|
||||
id_string = "28e32c71-1450-463e-92bf-e0a46446fc11"
|
||||
out = mb.album_for_id(id_string)
|
||||
self.assertEqual(out.album_id, id_string)
|
||||
|
||||
def test_album_for_id_non_id_returns_none(self):
|
||||
id_string = "blah blah"
|
||||
out = mb.album_for_id(id_string)
|
||||
self.assertEqual(out, None)
|
||||
|
||||
def test_album_for_id_url_finds_id(self):
|
||||
id_string = "28e32c71-1450-463e-92bf-e0a46446fc11"
|
||||
id_url = "http://musicbrainz.org/entity/%s" % id_string
|
||||
out = mb.album_for_id(id_url)
|
||||
self.assertEqual(out.album_id, id_string)
|
||||
|
||||
class ArtistFlatteningTest(unittest.TestCase):
|
||||
def _credit_dict(self, suffix=''):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -585,28 +585,6 @@ class ShowdiffTest(_common.TestCase):
|
|||
|
||||
self.assertEqual(complete_diff, partial_diff)
|
||||
|
||||
AN_ID = "28e32c71-1450-463e-92bf-e0a46446fc11"
|
||||
class ManualIDTest(_common.TestCase):
|
||||
def setUp(self):
|
||||
super(ManualIDTest, self).setUp()
|
||||
_common.log.setLevel(logging.CRITICAL)
|
||||
self.io.install()
|
||||
|
||||
def test_id_accepted(self):
|
||||
self.io.addinput(AN_ID)
|
||||
out = commands.manual_id(False)
|
||||
self.assertEqual(out, AN_ID)
|
||||
|
||||
def test_non_id_returns_none(self):
|
||||
self.io.addinput("blah blah")
|
||||
out = commands.manual_id(False)
|
||||
self.assertEqual(out, None)
|
||||
|
||||
def test_url_finds_id(self):
|
||||
self.io.addinput("http://musicbrainz.org/entity/%s?something" % AN_ID)
|
||||
out = commands.manual_id(False)
|
||||
self.assertEqual(out, AN_ID)
|
||||
|
||||
class ShowChangeTest(_common.TestCase):
|
||||
def setUp(self):
|
||||
super(ShowChangeTest, self).setUp()
|
||||
|
|
|
|||
Loading…
Reference in a new issue