exc: Add {Backend,Frontend,Mixer}Error exceptions

(cherry picked from commit bf8307f329)
This commit is contained in:
Stein Magnus Jodal 2014-07-09 22:17:46 +02:00
parent 7e489ccb0b
commit 44664f2796
2 changed files with 24 additions and 0 deletions

View File

@ -16,9 +16,21 @@ class MopidyException(Exception):
self._message = message
class BackendError(MopidyException):
pass
class ExtensionError(MopidyException):
pass
class FrontendError(MopidyException):
pass
class MixerError(MopidyException):
pass
class ScannerError(MopidyException):
pass

View File

@ -12,10 +12,22 @@ class ExceptionsTest(unittest.TestCase):
self.assertEqual(exc.message, 'foo')
self.assertEqual(str(exc), 'foo')
def test_backend_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.BackendError, exceptions.MopidyException))
def test_extension_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.ExtensionError, exceptions.MopidyException))
def test_frontend_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.FrontendError, exceptions.MopidyException))
def test_mixer_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.MixerError, exceptions.MopidyException))
def test_scanner_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.ScannerError, exceptions.MopidyException))