tests: Test existing exception classes
This commit is contained in:
parent
f89f4151b0
commit
059147723b
21
tests/exceptions_test.py
Normal file
21
tests/exceptions_test.py
Normal file
@ -0,0 +1,21 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from mopidy import exceptions
|
||||
|
||||
from tests import unittest
|
||||
|
||||
|
||||
class ExceptionsTest(unittest.TestCase):
|
||||
def test_exception_can_include_message_string(self):
|
||||
exc = exceptions.MopidyException('foo')
|
||||
|
||||
self.assertEqual(exc.message, 'foo')
|
||||
self.assertEqual(str(exc), 'foo')
|
||||
|
||||
def test_settings_error_is_a_mopidy_exception(self):
|
||||
self.assert_(issubclass(
|
||||
exceptions.SettingsError, exceptions.MopidyException))
|
||||
|
||||
def test_optional_dependency_error_is_a_mopidy_exception(self):
|
||||
self.assert_(issubclass(
|
||||
exceptions.OptionalDependencyError, exceptions.MopidyException))
|
||||
Loading…
Reference in New Issue
Block a user