示例#1
0
def test_get_event_broker_from_endpoint_config_error_exit(tmp_path: Path):
    # write config without event broker to file
    endpoints_path = write_endpoint_config_to_yaml(
        tmp_path, {"tracker_store": {"type": "sql"}}
    )

    available_endpoints = rasa_core_utils.read_endpoints_from_path(endpoints_path)

    with pytest.raises(SystemExit):
        assert export._get_event_broker(available_endpoints)
示例#2
0
def test_get_event_broker_and_tracker_store_from_endpoint_config(
        tmp_path: Path):
    # write valid config to file
    endpoints_path = write_endpoint_config_to_yaml(tmp_path, {
        "event_broker": {
            "type": "sql"
        },
        "tracker_store": {
            "type": "sql"
        }
    })

    available_endpoints = rasa_core_utils.read_endpoints_from_path(
        endpoints_path)

    # fetching the event broker is successful
    assert export._get_event_broker(available_endpoints)
    assert export._get_tracker_store(available_endpoints)