コード例 #1
0
ファイル: test_agent.py プロジェクト: hnithyanandam/rasa
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)
コード例 #2
0
ファイル: test_domain.py プロジェクト: yungliu/rasa_nlu
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)
コード例 #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)