File: test_extension.py

package info (click to toggle)
mopidy-mpris 3.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 340 kB
  • sloc: python: 1,689; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
import unittest
from unittest import mock

from mopidy_mpris import Extension
from mopidy_mpris import frontend as frontend_lib


class ExtensionTest(unittest.TestCase):
    def test_get_default_config(self):
        ext = Extension()

        config = ext.get_default_config()

        self.assertIn("[mpris]", config)
        self.assertIn("enabled = true", config)
        self.assertIn("bus_type = session", config)

    def test_get_config_schema(self):
        ext = Extension()

        schema = ext.get_config_schema()

        self.assertIn("desktop_file", schema)
        self.assertIn("bus_type", schema)

    def test_get_frontend_classes(self):
        ext = Extension()
        registry = mock.Mock()

        ext.setup(registry)

        registry.add.assert_called_once_with(
            "frontend", frontend_lib.MprisFrontend
        )