mirror of
https://github.com/beetbox/beets.git
synced 2026-02-21 23:03:26 +01:00
Add a test for Deezer ID extraction
This commit is contained in:
parent
c1299f64a1
commit
af600497ee
1 changed files with 21 additions and 0 deletions
|
|
@ -582,6 +582,27 @@ class ParseSpotifyIDTest(unittest.TestCase):
|
|||
self.assertEqual(out, id_string)
|
||||
|
||||
|
||||
class ParseDeezerIDTest(unittest.TestCase):
|
||||
def test_parse_id_correct(self):
|
||||
id_string = "176356382"
|
||||
out = MetadataSourcePlugin._get_id(
|
||||
"album", id_string, deezer_id_regex)
|
||||
self.assertEqual(out, id_string)
|
||||
|
||||
def test_parse_id_non_id_returns_none(self):
|
||||
id_string = "blah blah"
|
||||
out = MetadataSourcePlugin._get_id(
|
||||
"album", id_string, deezer_id_regex)
|
||||
self.assertEqual(out, None)
|
||||
|
||||
def test_parse_id_url_finds_id(self):
|
||||
id_string = "176356382"
|
||||
id_url = "https://www.deezer.com/album/%s" % id_string
|
||||
out = MetadataSourcePlugin._get_id(
|
||||
"album", id_url, deezer_id_regex)
|
||||
self.assertEqual(out, id_string)
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue