config: More review fixes and fixed help test.
This commit is contained in:
parent
54a59f5968
commit
0d30db7e5f
@ -193,7 +193,7 @@ def check_old_folders():
|
||||
def load_extensions():
|
||||
extensions = []
|
||||
for entry_point in pkg_resources.iter_entry_points('mopidy.ext'):
|
||||
logger.debug('Loading entrypoint: %s', entry_point)
|
||||
logger.debug('Loading entry point: %s', entry_point)
|
||||
|
||||
try:
|
||||
extension_class = entry_point.load()
|
||||
@ -292,8 +292,7 @@ def validate_config(raw_config, extensions):
|
||||
errors = {}
|
||||
for section_name, schema in sections_and_schemas:
|
||||
if section_name not in raw_config:
|
||||
logger.error('Config section %s not found', section_name)
|
||||
process.exit_process()
|
||||
errors[section_name] = {section_name: 'section not found'}
|
||||
try:
|
||||
items = raw_config[section_name].items()
|
||||
config[section_name] = schema.convert(items)
|
||||
@ -305,7 +304,7 @@ def validate_config(raw_config, extensions):
|
||||
logger.error('[%s] config errors:', section_name)
|
||||
for key in error:
|
||||
logger.error('%s %s', key, error[key])
|
||||
process.exit_process()
|
||||
sys.exit(1)
|
||||
|
||||
return config
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ class ConfigSchema(object):
|
||||
class ExtensionConfigSchema(ConfigSchema):
|
||||
"""Sub-classed :class:`ConfigSchema` for use in extensions.
|
||||
|
||||
Ensures that `enabled` config value is present.
|
||||
Ensures that ``enabled`` config value is present.
|
||||
"""
|
||||
def __init__(self):
|
||||
super(ExtensionConfigSchema, self).__init__()
|
||||
|
||||
@ -17,7 +17,7 @@ class AudioTest(unittest.TestCase):
|
||||
settings.MIXER = 'fakemixer track_max_volume=65536'
|
||||
settings.OUTPUT = 'fakesink'
|
||||
self.song_uri = path_to_uri(path_to_data_dir('song1.wav'))
|
||||
self.audio = audio.Audio.start(None).proxy()
|
||||
self.audio = audio.Audio.start(config=None).proxy()
|
||||
|
||||
def tearDown(self):
|
||||
pykka.ActorRegistry.stop_all()
|
||||
@ -60,7 +60,7 @@ class AudioTest(unittest.TestCase):
|
||||
|
||||
def test_set_volume_with_mixer_max_below_100(self):
|
||||
settings.MIXER = 'fakemixer track_max_volume=40'
|
||||
self.audio = audio.Audio.start(None).proxy()
|
||||
self.audio = audio.Audio.start(config=None).proxy()
|
||||
|
||||
for value in range(0, 101):
|
||||
self.assertTrue(self.audio.set_volume(value).get())
|
||||
@ -81,7 +81,7 @@ class AudioTest(unittest.TestCase):
|
||||
|
||||
class AudioStateTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.audio = audio.Audio(None)
|
||||
self.audio = audio.Audio(config=None)
|
||||
|
||||
def test_state_starts_as_stopped(self):
|
||||
self.assertEqual(audio.PlaybackState.STOPPED, self.audio.state)
|
||||
|
||||
@ -22,7 +22,9 @@ class HelpTest(unittest.TestCase):
|
||||
self.assertIn('--quiet', output)
|
||||
self.assertIn('--verbose', output)
|
||||
self.assertIn('--save-debug-log', output)
|
||||
self.assertIn('--list-settings', output)
|
||||
self.assertIn('--show-config', output)
|
||||
self.assertIn('--config', output)
|
||||
self.assertIn('--option', output)
|
||||
|
||||
def test_help_gst_has_gstreamer_options(self):
|
||||
mopidy_dir = os.path.dirname(mopidy.__file__)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user