From 6146f45e82b8556b3208895b27311f0b1d70d057 Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Sat, 23 May 2020 16:22:18 +0200 Subject: [PATCH] add `--port` parameter for interactive learning (#5837) * fixrd a bug * Run Black code formatter * used add_server_arguments to get the port from cmd instead * to remove unwanted print statement * Revert "used add_server_arguments to get the port from cmd instead" This reverts commit cf6ec6f6d3902240b09743208ac49c6812987997. * used add_server_argument to get the port from cmd for interactive * Update rasa/core/training/interactive.py Co-authored-by: Tobias Wochinger * added changelog2 * added port argument * fixed tests Co-authored-by: Padma Nandhini Co-authored-by: Tobias Wochinger --- test_rasa_interactive.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test_rasa_interactive.py b/test_rasa_interactive.py index b869ebedd7ac..a9b401a86ada 100644 --- a/test_rasa_interactive.py +++ b/test_rasa_interactive.py @@ -13,7 +13,7 @@ def test_interactive_help(run: Callable[..., RunResult]): output = run("interactive", "--help") - help_text = """usage: rasa interactive [-h] [-v] [-vv] [--quiet] [--e2e] [-m MODEL] + help_text = """usage: rasa interactive [-h] [-v] [-vv] [--quiet] [--e2e] [-p PORT] [-m MODEL] [--data DATA [DATA ...]] [--skip-visualization] [--conversation-id CONVERSATION_ID] [--endpoints ENDPOINTS] [-c CONFIG] [-d DOMAIN] @@ -35,7 +35,7 @@ def test_interactive_core_help(run: Callable[..., RunResult]): [--conversation-id CONVERSATION_ID] [--endpoints ENDPOINTS] [-c CONFIG] [-d DOMAIN] [--out OUT] [--augmentation AUGMENTATION] - [--debug-plots] + [--debug-plots] [-p PORT] [model-as-positional-argument]""" lines = help_text.split("\n") @@ -182,7 +182,9 @@ def test_pass_conversation_id_to_interactive_learning(monkeypatch: MonkeyPatch): do_interactive_learning(args, Mock()) - _serve_application.assert_called_once_with(ANY, ANY, True, expected_conversation_id) + _serve_application.assert_called_once_with( + ANY, ANY, True, expected_conversation_id, 5005 + ) def test_generate_conversation_id_for_interactive_learning(monkeypatch: MonkeyPatch):