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)
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)
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)
def test_default_config_file(): final_config = config.RasaNLUModelConfig() assert len(final_config) > 1
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)
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)