Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tabergma committed May 14, 2020
1 parent 7c94557 commit a7aee34
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions test_rasa_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,40 @@ def test_test(run_in_default_project: Callable[..., RunResult]):
run_in_default_project("test")

assert os.path.exists("results")
assert os.path.exists("results/hist.png")
assert os.path.exists("results/confmat.png")
assert os.path.exists("results/intent_histogram.png")
assert os.path.exists("results/intent_confusion_matrix.png")


def test_test_no_plot(run_in_default_project: Callable[..., RunResult]):
run_in_default_project("test", "--no-plot")

assert not os.path.exists("results/hist.png")
assert not os.path.exists("results/confmat.png")
assert not os.path.exists("results/intent_histogram.png")
assert not os.path.exists("results/intent_confusion_matrix.png")
assert not os.path.exists("results/story_confmat.pdf")


def test_test_nlu(run_in_default_project: Callable[..., RunResult]):
run_in_default_project("test", "nlu", "--nlu", "data", "--successes")

assert os.path.exists("results/hist.png")
assert os.path.exists("results/confmat.png")
assert os.path.exists("results/intent_histogram.png")
assert os.path.exists("results/intent_confusion_matrix.png")
assert os.path.exists("results/intent_successes.json")


def test_test_nlu_no_plot(run_in_default_project: Callable[..., RunResult]):
run_in_default_project("test", "nlu", "--no-plot")

assert not os.path.exists("results/confmat.png")
assert not os.path.exists("results/hist.png")
assert not os.path.exists("results/intent_histogram.png")
assert not os.path.exists("results/intent_confusion_matrix.png")


def test_test_nlu_cross_validation(run_in_default_project: Callable[..., RunResult]):
run_in_default_project(
"test", "nlu", "--cross-validation", "-c", "config.yml", "-f", "2"
)

assert os.path.exists("results/hist.png")
assert os.path.exists("results/confmat.png")
assert os.path.exists("results/intent_histogram.png")
assert os.path.exists("results/intent_confusion_matrix.png")


def test_test_nlu_comparison(
Expand Down Expand Up @@ -164,8 +164,7 @@ def test_test_help(run: Callable[..., RunResult]):
[--max-stories MAX_STORIES] [--endpoints ENDPOINTS]
[--fail-on-prediction-errors] [--url URL]
[--evaluate-model-directory] [-u NLU] [--out OUT]
[--successes] [--no-errors] [--histogram HISTOGRAM]
[--confmat CONFMAT] [-c CONFIG [CONFIG ...]]
[--successes] [--no-errors] [-c CONFIG [CONFIG ...]]
[--cross-validation] [-f FOLDS] [-r RUNS]
[-p PERCENTAGES [PERCENTAGES ...]] [--no-plot]
{core,nlu} ..."""
Expand All @@ -180,8 +179,7 @@ def test_test_nlu_help(run: Callable[..., RunResult]):
output = run("test", "nlu", "--help")

help_text = """usage: rasa test nlu [-h] [-v] [-vv] [--quiet] [-m MODEL] [-u NLU] [--out OUT]
[--successes] [--no-errors] [--histogram HISTOGRAM]
[--confmat CONFMAT] [-c CONFIG [CONFIG ...]]
[--successes] [--no-errors] [-c CONFIG [CONFIG ...]]
[--cross-validation] [-f FOLDS] [-r RUNS]
[-p PERCENTAGES [PERCENTAGES ...]] [--no-plot]"""

Expand Down

0 comments on commit a7aee34

Please sign in to comment.