File: test_exceptions.py

package info (click to toggle)
mopidy 3.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,608 kB
  • sloc: python: 16,656; sh: 159; makefile: 127
file content (29 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import unittest

from mopidy import exceptions


class ExceptionsTest(unittest.TestCase):
    def test_exception_can_include_message_string(self):
        exc = exceptions.MopidyException("foo")

        assert exc.message == "foo"
        assert str(exc) == "foo"

    def test_backend_error_is_a_mopidy_exception(self):
        assert issubclass(exceptions.BackendError, exceptions.MopidyException)

    def test_extension_error_is_a_mopidy_exception(self):
        assert issubclass(exceptions.ExtensionError, exceptions.MopidyException)

    def test_frontend_error_is_a_mopidy_exception(self):
        assert issubclass(exceptions.FrontendError, exceptions.MopidyException)

    def test_mixer_error_is_a_mopidy_exception(self):
        assert issubclass(exceptions.MixerError, exceptions.MopidyException)

    def test_scanner_error_is_a_mopidy_exception(self):
        assert issubclass(exceptions.ScannerError, exceptions.MopidyException)

    def test_audio_error_is_a_mopidy_exception(self):
        assert issubclass(exceptions.AudioException, exceptions.MopidyException)