コード例 #1
0
def test_create_intent(capsys):
    intent_management.create_intent(PROJECT_ID, INTENT_DISPLAY_NAME,
                                    TRAINING_PHRASE_PARTS, MESSAGE_TEXTS)

    intent_ids = intent_management._get_intent_ids(PROJECT_ID,
                                                   INTENT_DISPLAY_NAME)

    assert len(intent_ids) == 1

    intent_management.list_intents(PROJECT_ID)

    out, _ = capsys.readouterr()

    assert INTENT_DISPLAY_NAME in out

    for message_text in MESSAGE_TEXTS:
        assert message_text in out
def test_create_intent(capsys):
    intent_management.create_intent(
        PROJECT_ID, INTENT_DISPLAY_NAME, TRAINING_PHRASE_PARTS,
        MESSAGE_TEXTS)

    intent_ids = intent_management._get_intent_ids(
        PROJECT_ID, INTENT_DISPLAY_NAME)

    assert len(intent_ids) == 1

    intent_management.list_intents(PROJECT_ID)

    out, _ = capsys.readouterr()

    assert INTENT_DISPLAY_NAME in out

    for message_text in MESSAGE_TEXTS:
        assert message_text in out