summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
da5d3f4)
Controls name attribute is str type
self.__aliases = set()
self.log = logging.getLogger(__name__)
if 'name' not in kwargs or not kwargs.get('name'):
self.__aliases = set()
self.log = logging.getLogger(__name__)
if 'name' not in kwargs or not kwargs.get('name'):
- raise MetaException('Need a "name" argument')
+ raise MetaException('Need a "name" argument (str type)')
+ elif not isinstance(kwargs.get('name'), str):
+ raise MetaException('"name" argument not a string')
else:
self.__name = kwargs.pop('name')
if 'mbid' in kwargs and kwargs.get('mbid'):
else:
self.__name = kwargs.pop('name')
if 'mbid' in kwargs and kwargs.get('mbid'):
for args in [
{'mbid':VALID},
{'name': None},
for args in [
{'mbid':VALID},
{'name': None},
]:
with self.assertRaises(MetaException,
msg='{} does not raise an except.'.format(args)):
]:
with self.assertRaises(MetaException,
msg='{} does not raise an except.'.format(args)):