def check_config(config, name): yakonfig.check_toplevel_config(kvlayer, name) for ndx in config['indexes']: if ndx not in to_kvlayer.index_sizes: raise yakonfig.ConfigurationError( 'invalid {} indexes type {!r}' .format(name, ndx))
def test_check_dependent(): # give an invalid configuration for args; but it's not the "real" # application so it shouldn't be checked with yakonfig.defaulted_config([ConfigurableArgs(), ConfigurableLike], {'key': 'value'}) as config: assert sorted(iterkeys(config)) == ['config', 'configurable'] with pytest.raises(yakonfig.ConfigurationError): yakonfig.check_toplevel_config(ConfigurableArgs(), 'test') with pytest.raises(yakonfig.ConfigurationError): yakonfig.check_toplevel_config(ConfigurableTop, 'test')
def check_config(config, name): if ('engine' not in config or config['engine'] not in ['rejester', 'standalone']): raise yakonfig.ConfigurationError( 'invalid {} engine type {!r}' .format(name, config.get('engine'))) if ('mode' not in config or config['mode'] not in ['directories', 'files', 'file-lists']): raise yakonfig.ConfigurationError( 'invalid {} mode {!r}'.format(name, config.get('mode'))) if config['engine'] == 'rejester': yakonfig.check_toplevel_config(rejester, name) yakonfig.check_toplevel_config(streamcorpus_pipeline, name)
def check_config(config, name): if ('engine' not in config or config['engine'] not in ['rejester', 'standalone']): raise yakonfig.ConfigurationError( 'invalid {} engine type {!r}'.format(name, config.get('engine'))) if ('mode' not in config or config['mode'] not in ['directories', 'files', 'file-lists']): raise yakonfig.ConfigurationError('invalid {} mode {!r}'.format( name, config.get('mode'))) if config['engine'] == 'rejester': yakonfig.check_toplevel_config(rejester, name) yakonfig.check_toplevel_config(streamcorpus_pipeline, name)
def check_config(config, name): yakonfig.check_toplevel_config(kvlayer, name)
def check_config(config, name): yakonfig.check_toplevel_config(kvlayer, name) for ndx in config['indexes']: if ndx not in to_kvlayer.index_sizes: raise yakonfig.ConfigurationError( 'invalid {} indexes type {!r}'.format(name, ndx))
def check_config(config, name): yakonfig.check_toplevel_config(ConfigurableArgs(), name)