예제 #1
0
def test_invalid_many_tokenizers_in_config():
    nlu_config = {
        "pipeline": [{"name": "WhitespaceTokenizer"}, {"name": "SpacyTokenizer"}]
    }

    with pytest.raises(config.InvalidConfigError) as execinfo:
        Trainer(config.RasaNLUModelConfig(nlu_config))
    assert "More then one tokenizer is used" in str(execinfo.value)
예제 #2
0
파일: test_config.py 프로젝트: attgua/Geco
def test_invalid_many_tokenizers_in_config():
    nlu_config = {
        "pipeline": [{"name": "WhitespaceTokenizer"}, {"name": "SpacyTokenizer"}]
    }

    with pytest.raises(InvalidConfigException) as execinfo:
        Trainer(config.RasaNLUModelConfig(nlu_config))
    assert "The pipeline configuration contains more than one" in str(execinfo.value)
예제 #3
0
def test_missing_property(pipeline_config):
    with pytest.raises(config.InvalidConfigError) as execinfo:
        Trainer(config.RasaNLUModelConfig(pipeline_config))
    assert "Add required components to the pipeline" in str(execinfo.value)
예제 #4
0
def test_default_config_file():
    final_config = config.RasaNLUModelConfig()
    assert len(final_config) > 1
예제 #5
0
def test_missing_property(pipeline_config):
    with pytest.raises(config.InvalidConfigError) as execinfo:
        Trainer(config.RasaNLUModelConfig(pipeline_config))
    assert "The pipeline configuration contains errors" in str(execinfo.value)
예제 #6
0
def test_missing_required_component(_config):
    with pytest.raises(InvalidConfigException) as execinfo:
        Trainer(config.RasaNLUModelConfig(_config))
    assert "The pipeline configuration contains errors" in str(execinfo.value)