X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=tests%2Ftest_meta.py;fp=tests%2Ftest_meta.py;h=96b4e0d00dae6c0cef27b1f0e18b5fe5beee725f;hb=f0912ba70260d43fc4885f6d75c2e83b6fb5a8d1;hp=071e925cf9e4feda81b5a85359e305700020d717;hpb=83d4cd0d2ac162f2f40547858da1e88a63e5c01f;p=mpd-sima.git diff --git a/tests/test_meta.py b/tests/test_meta.py index 071e925..96b4e0d 100644 --- a/tests/test_meta.py +++ b/tests/test_meta.py @@ -3,7 +3,7 @@ import unittest from sima.lib.meta import Meta, Artist, MetaContainer, is_uuid4 -from sima.lib.meta import WrongUUID4, MetaException +from sima.lib.meta import WrongUUID4, MetaException, SEPARATOR VALID = '110e8100-e29b-41d1-a716-116655250000' @@ -106,7 +106,7 @@ class TestMetaObject(unittest.TestCase): class TestArtistObject(unittest.TestCase): def test_init(self): - artist = {'artist': ', '.join(['Original Name', 'Featuring Nane', 'Feature…']), + artist = {'artist': SEPARATOR.join(['Original Name', 'Featuring Nane', 'Feature…']), 'albumartist': 'Name', 'musicbrainz_artistid': VALID, 'musicbrainz_albumartistid': VALID.replace('11', '22'), @@ -121,6 +121,15 @@ class TestArtistObject(unittest.TestCase): art = Artist(**artist) self.assertTrue(art.name == 'Original Name', art.name) + def test_empty_name(self): + for args in [ + {'mbid':VALID}, + {'name': None}, + {}, + ]: + with self.assertRaises(MetaException, + msg='{} does not raise an except.'.format(args)): + Artist(**args) class TestMetaContainers(unittest.TestCase):