Пример #1
0
 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))
Пример #2
0
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')
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 def check_config(config, name):
     yakonfig.check_toplevel_config(kvlayer, name)
Пример #6
0
 def check_config(config, name):
     yakonfig.check_toplevel_config(kvlayer, name)
Пример #7
0
 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))
Пример #8
0
 def check_config(config, name):
     yakonfig.check_toplevel_config(ConfigurableArgs(), name)