async def test_graph_persistence(default_domain, tmpdir):
    from os.path import isfile
    from networkx.drawing import nx_pydot
    from rasa.core.training.dsl import StoryFileReader
    from rasa.core.interpreter import RegexInterpreter
    story_steps = (await StoryFileReader.read_from_file('data/test_stories/stories.md', default_domain, interpreter=RegexInterpreter()))
    out_file = tmpdir.join('graph.html').strpath
    generated_graph = (await visualization.visualize_stories(story_steps, default_domain, output_file=out_file, max_history=3, should_merge_nodes=False))
    generated_graph = nx_pydot.to_pydot(generated_graph)
    assert isfile(out_file)
    with open(out_file, 'r') as graph_file:
        content = graph_file.read()
    assert ('isClient = true' in content)
    assert ('graph = `{}`'.format(generated_graph.to_string()) in content)
async def test_graph_persistence(default_domain, tmpdir):
    from os.path import isfile
    from networkx.drawing import nx_pydot
    from rasa.core.training.dsl import StoryFileReader
    from rasa.core.interpreter import RegexInterpreter
    story_steps = (await StoryFileReader.read_from_file('data/test_stories/stories.md', default_domain, interpreter=RegexInterpreter()))
    out_file = tmpdir.join('graph.html').strpath
    generated_graph = (await visualization.visualize_stories(story_steps, default_domain, output_file=out_file, max_history=3, should_merge_nodes=False))
    generated_graph = nx_pydot.to_pydot(generated_graph)
    assert isfile(out_file)
    with open(out_file, 'r') as graph_file:
        content = graph_file.read()
    assert ('isClient = true' in content)
    assert ('graph = `{}`'.format(generated_graph.to_string()) in content)