Пример #1
0
def render_all(maximal_label=MAXIMAL_LABEL, topdown=TOPDOWN,
               directory=DIRECTORY, format=None):  # pragma: no cover
    from features.systems import FeatureSystem
    from features.meta import Config

    for conf in Config:
        fs = FeatureSystem(conf)
        dot = fs.graphviz(maximal_label=maximal_label, topdown=topdown,
                          directory=directory, format=format)
        dot.render()
Пример #2
0
def render_all(maximal_label=MAXIMAL_LABEL,
               topdown=TOPDOWN,
               directory=DIRECTORY,
               format=None):
    from features.systems import FeatureSystem
    from features.meta import Config

    for conf in Config:
        fs = FeatureSystem(conf)
        dot = fs.graphviz(None, maximal_label, topdown, None, directory)
        if format is not None:
            dot.format = format
        dot.render()
Пример #3
0
def test_init_substrings():
    context = '''
        |egg|eggs|
    spam| X |    |
    ham |   | X  |
    '''
    config = Config.create(context=context)
    with pytest.raises(ValueError, match=r'substring'):
        FeatureSystem(config)
Пример #4
0
def test_init_inatomic():
    context = '''
        |catholic|protestant|
    spam|    X   |          |
    eggs|    X   |          |
    ham |        |     X    |
    '''
    config = Config.create(context=context)
    with pytest.raises(ValueError, match=r'individual'):
        FeatureSystem(config)
Пример #5
0
def fs(name='plural'):
    return FeatureSystem(name)
Пример #6
0
def fs_noname(fs):
    config = Config.create(context=fs._config.context)
    return FeatureSystem(config)