Beispiel #1
0
def test_local_action_factory_fails_on_duplicated_actions():
    actions = ["action_listen",
               "rasa_core.actions.action.ActionListen",
               "utter_test"]
    with pytest.raises(ValueError):
        TemplateDomain.instantiate_actions(
                "local", actions, None, ["utter_test"])
Beispiel #2
0
def test_local_action_factory_fails_on_duplicated_actions():
    actions = [
        "action_listen", "rasa_core.actions.action.ActionListen", "utter_test"
    ]
    with pytest.raises(ValueError):
        TemplateDomain.instantiate_actions("local", actions, None,
                                           ["utter_test"])
Beispiel #3
0
def test_domain_action_instantiation():
    instantiated_actions = TemplateDomain.instantiate_actions(
        "remote", ["my_module.ActionTest", "utter_test"],
        ["action_test", "utter_test"], ["utter_test"])
    assert len(instantiated_actions) == 4
    assert instantiated_actions[0].name() == "action_listen"
    assert instantiated_actions[1].name() == "action_restart"
    assert instantiated_actions[2].name() == "action_test"
    assert instantiated_actions[3].name() == "utter_test"
Beispiel #4
0
def test_domain_action_instantiation():
    instantiated_actions = TemplateDomain.instantiate_actions(
            "remote",
            ["my_module.ActionTest", "utter_test"],
            ["action_test", "utter_test"],
            ["utter_test"])
    assert len(instantiated_actions) == 5
    assert instantiated_actions[0].name() == "action_listen"
    assert instantiated_actions[1].name() == "action_restart"
    assert instantiated_actions[2].name() == "action_default_fallback"
    assert instantiated_actions[3].name() == "action_test"
    assert instantiated_actions[4].name() == "utter_test"
Beispiel #5
0
def test_remote_action_factory_fails_on_duplicated_actions():
    with pytest.raises(ValueError):
        TemplateDomain.instantiate_actions(
                "remote", ["action_listen", "random_name", "random_name"],
                None, ["utter_test"])
Beispiel #6
0
def test_remote_action_factory_fails_on_duplicated_actions():
    with pytest.raises(ValueError):
        TemplateDomain.instantiate_actions(
            "remote", ["action_listen", "random_name", "random_name"], None,
            ["utter_test"])