config: Add regression test for format_initial()
This commit is contained in:
parent
0d3563441f
commit
0ae6239988
@ -6,7 +6,7 @@ import unittest
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from mopidy import config
|
from mopidy import config, ext
|
||||||
|
|
||||||
from tests import path_to_data_dir
|
from tests import path_to_data_dir
|
||||||
|
|
||||||
@ -292,3 +292,23 @@ class PostProcessorTest(unittest.TestCase):
|
|||||||
def test_conversion(self):
|
def test_conversion(self):
|
||||||
result = config._postprocess(PROCESSED_CONFIG)
|
result = config._postprocess(PROCESSED_CONFIG)
|
||||||
self.assertEqual(result, INPUT_CONFIG)
|
self.assertEqual(result, INPUT_CONFIG)
|
||||||
|
|
||||||
|
|
||||||
|
def test_format_initial():
|
||||||
|
extension = ext.Extension()
|
||||||
|
extension.ext_name = 'foo'
|
||||||
|
extension.get_default_config = lambda: None
|
||||||
|
extensions_data = [
|
||||||
|
ext.ExtensionData(
|
||||||
|
extension=extension,
|
||||||
|
entry_point=None,
|
||||||
|
config_schema=None,
|
||||||
|
config_defaults=None,
|
||||||
|
command=None,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
result = config.format_initial(extensions_data)
|
||||||
|
|
||||||
|
assert '# For further information' in result
|
||||||
|
assert '[foo]\n' in result
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user