def test_react_to_intent(mocker): from ravestate_verbaliser import verbaliser verbaliser.add_file(join(dirname(realpath(__file__)), "verbaliser_testfiles", "phrases_test.yml")) import ravestate_verbaliser test_dict = {'verbaliser:intent': 'test1'} ravestate_verbaliser.react_to_intent(test_dict) assert test_dict["rawio:out"] in ravestate_verbaliser.verbaliser.get_phrase_list('test1')
def test_react_to_intent_no_phrase(mocker): from ravestate_verbaliser import verbaliser verbaliser.add_file(join(dirname(realpath(__file__)), "verbaliser_testfiles", "phrases_test.yml")) import ravestate_verbaliser test_dict = {'verbaliser:intent': 'test'} ravestate_verbaliser.react_to_intent(test_dict) assert "rawio:out" not in test_dict
def test_add_file_mixed(): verbaliser.add_file( join(dirname(realpath(__file__)), "verbaliser_testfiles", "mixed_test.yml")) assert_mixed_file()
def test_add_file_qa(): verbaliser.add_file( join(dirname(realpath(__file__)), "verbaliser_testfiles", "QAList_test.yml")) assert_qa_file()
def test_add_file_phrases(): verbaliser.add_file( join(dirname(realpath(__file__)), "verbaliser_testfiles", "phrases_test.yml")) assert_phrases_file()
def test_add_file_nonexistent(): assert not verbaliser.add_file( join(dirname(realpath(__file__)), "verbaliser_testfiles", "nonexistent.yml"))
def test_add_file_wrongformat(): assert not verbaliser.add_file( join(dirname(realpath(__file__)), "verbaliser_testfiles", "wrongformat_test.yml"))
def test_add_file_nosection(): verbaliser.add_file( join(dirname(realpath(__file__)), "verbaliser_testfiles", "nosection_test.yml")) assert_nosection_file()