Ejemplo n.º 1
0
def test_conv_getnewfactintent_3(client):
    """
    User should get a new fact, Amazon should keep the session open,
    and should include at least 5 different phrase options to prefix
    the get fact message. Further, the prefix should be randomly
    assigned.

    :param client
    """
    response = post(client, requests.get_new_fact())

    assert response['response']['outputSpeech']['text'],\
        "should have a response"

    RESULTS.append(response['response']['outputSpeech']['text'])

    assert response['response']['shouldEndSession'] is not None,\
        "should not end the alexa session"
    assert not response['response']['shouldEndSession'],\
        "should not end the alexa session"

    assert len(FACT_MSGS) >= 5,\
        "should include at least 5 different phrase options"

    assert get_num_included_phrases(RESULTS, FACT_MSGS),\
        "should randomly include segments from the GET_FACT_MESSAGE templates"
Ejemplo n.º 2
0
def test_get_new_fact_2(client):
    """
    """
    response = post(client, requests.get_new_fact())

    assert response['response']['card'],\
        "should have a card response"

    # add fact to array
    msg = response['response']['outputSpeech']['text']
    RESULTS.append(msg)
Ejemplo n.º 3
0
def test_get_new_fact_3(client):
    """
    """
    response = post(client, requests.get_new_fact())

    # add fact to array
    msg = response['response']['outputSpeech']['text']
    RESULTS.append(msg)

    assert len(RESULTS) >= 3,\
        "should have run three times"

    assert RESULTS[0] != RESULTS[1] or RESULTS[1] != RESULTS[2],\
        "should have a random spoken sequence"
Ejemplo n.º 4
0
def test_conv_getnewfactintent_1(client):
    """
    User should get a new fact and be reprompted

    :param client
    """
    response = post(client, requests.get_new_fact())

    assert response['response']['outputSpeech']['text'],\
        "should have a response"

    RESULTS.append(response['response']['outputSpeech']['text'])

    assert response['response']['reprompt'],\
        "should have reprompt"
Ejemplo n.º 5
0
def test_conv_getnewfactintent_2(client):
    """
    User should get a new fact and Amazon should keep the session open

    :param client
    """
    response = post(client, requests.get_new_fact())

    assert response['response']['outputSpeech']['text'],\
        "should have a response"

    RESULTS.append(response['response']['outputSpeech']['text'])

    assert response['response']['shouldEndSession'] is not None,\
        "should not end the alexa session"
    assert not response['response']['shouldEndSession'],\
        "should not end the alexa session"