Skip to content

Commit

Permalink
Merge 308e2d6 into 7e1fe61
Browse files Browse the repository at this point in the history
  • Loading branch information
gausie committed Jul 23, 2019
2 parents 7e1fe61 + 308e2d6 commit 8740651
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
9 changes: 6 additions & 3 deletions data/test_multifile_stories/stories_part_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
## show_it_all
> check_greet
> check_hello <!-- allows multiple entry points -->
* next_intent
- utter_greet <!-- actions taken by the bot -->

> check_intermediate <!-- allows intermediate checkpoints -->
* change_bank_details
- utter_default <!-- allows to end without checkpoints -->

## entities and slots
* greet{"cuisine": "italian"}
- slot{"cuisine": "italian"}
- utter_default
- utter_default <!-- just so length is different from the checkpoint story -->
6 changes: 6 additions & 0 deletions data/test_stories/stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@
> check_intermediate <!-- allows intermediate checkpoints -->
* change_bank_details
- utter_default <!-- allows to end without checkpoints -->

## entities and slots
* greet{"cuisine": "italian"}
- slot{"cuisine": "italian"}
- utter_default
- utter_default <!-- just so length is different from the checkpoint story -->
6 changes: 4 additions & 2 deletions tests/core/test_dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ async def test_can_read_test_story(default_domain):
tracker_limit=1000,
remove_duplicates=False,
)
assert len(trackers) == 7
assert len(trackers) == 8
# this should be the story simple_story_with_only_end -> show_it_all
# the generated stories are in a non stable order - therefore we need to
# do some trickery to find the one we want to test
tracker = [t for t in trackers if len(t.events) == 5][0]
trackers = [t for t in trackers if len(t.events) == 5]
assert len(trackers) == 1
tracker = trackers[0]
assert tracker.events[0] == ActionExecuted("action_listen")
assert tracker.events[1] == UserUttered(
"simple",
Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ async def test_story_visualization(default_domain, tmpdir):
should_merge_nodes=False,
)

assert len(generated_graph.nodes()) == 51
assert len(generated_graph.nodes()) == 54

assert len(generated_graph.edges()) == 56
assert len(generated_graph.edges()) == 60


async def test_story_visualization_with_merging(default_domain):
Expand Down
5 changes: 3 additions & 2 deletions tests/core/test_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ async def test_graph_persistence(default_domain, tmpdir):
should_merge_nodes=False,
)

generated_graph = nx_pydot.to_pydot(generated_graph)
generated_graph = str(nx_pydot.to_pydot(generated_graph))

assert isfile(out_file)

with open(out_file, "r") as graph_file:
content = graph_file.read()

assert r'label="/greet\{\"cuisine\":\ \"italian\"\}"' in generated_graph
assert "isClient = true" in content
assert "graph = `{}`".format(generated_graph.to_string()) in content
assert "graph = `{}`".format(generated_graph) in content

0 comments on commit 8740651

Please sign in to comment.