Exemplo n.º 1
0
async def test_missing_template_breaks_training(tmpdir,
                                                domain_missing_template):
    training_data_file = "examples/moodbot/data/stories.md"
    domain_path = utilities.write_text_to_file(tmpdir, "domain.yml",
                                               domain_missing_template)

    agent = Agent(domain_path, policies=[AugmentedMemoizationPolicy()])
    training_data = await agent.load_data(training_data_file)
    with pytest.raises(InvalidDomain):
        agent.train(training_data)
Exemplo n.º 2
0
def test_custom_slot_type(tmpdir):
    domain_path = utilities.write_text_to_file(
        tmpdir, "domain.yml", """
       slots:
         custom:
           type: tests.core.conftest.CustomSlot

       templates:
         utter_greet:
           - hey there!

       actions:
         - utter_greet """)
    Domain.load(domain_path)
Exemplo n.º 3
0
def test_domain_fails_on_unknown_custom_slot_type(tmpdir, domain_unkown_slot_type):
    domain_path = utilities.write_text_to_file(
        tmpdir, "domain.yml", domain_unkown_slot_type
    )
    with pytest.raises(ValueError):
        Domain.load(domain_path)