-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_extension.py
More file actions
36 lines (23 loc) · 910 Bytes
/
test_extension.py
File metadata and controls
36 lines (23 loc) · 910 Bytes
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
35
36
from __future__ import unicode_literals
import mock
import unittest
from mopidy_vkontakte import Extension, actor as backend_lib
class ExtensionTest(unittest.TestCase):
def test_get_default_config(self):
ext = Extension()
config = ext.get_default_config()
self.assertIn('[vkontakte]', config)
self.assertIn('enabled = true', config)
self.assertIn('email =', config)
self.assertIn('password =', config)
self.assertIn('client_id = 4003293', config)
def test_get_config_schema(self):
ext = Extension()
schema = ext.get_config_schema()
self.assertIn('email', schema)
self.assertIn('password', schema)
def test_get_backend_classes(self):
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_once_with('backend', backend_lib.VKBackend)