Don't use the 'id' field since it can be autogenerated (fixes #10551). (#10554)

This commit is contained in:
Kenny Millington 2017-11-14 06:46:26 +00:00 committed by Paulus Schoutsen
parent e33451e2b9
commit 7c24d77031
2 changed files with 1 additions and 66 deletions

View File

@ -155,9 +155,7 @@ class AlexaResponse(object):
if 'value' not in resolved:
continue
if 'id' in resolved['value']:
self.variables[underscored_key] = resolved['value']['id']
elif 'name' in resolved['value']:
if 'name' in resolved['value']:
self.variables[underscored_key] = resolved['value']['name']
def add_card(self, card_type, title, content):

View File

@ -208,69 +208,6 @@ def test_intent_request_with_slots(alexa_client):
assert text == "You told us your sign is virgo."
@asyncio.coroutine
def test_intent_request_with_slots_and_id_resolution(alexa_client):
"""Test a request with slots and an id synonym."""
data = {
"version": "1.0",
"session": {
"new": False,
"sessionId": SESSION_ID,
"application": {
"applicationId": APPLICATION_ID
},
"attributes": {
"supportedHoroscopePeriods": {
"daily": True,
"weekly": False,
"monthly": False
}
},
"user": {
"userId": "amzn1.account.AM3B00000000000000000000000"
}
},
"request": {
"type": "IntentRequest",
"requestId": REQUEST_ID,
"timestamp": "2015-05-13T12:34:56Z",
"intent": {
"name": "GetZodiacHoroscopeIntent",
"slots": {
"ZodiacSign": {
"name": "ZodiacSign",
"value": "virgo",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": AUTHORITY_ID,
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "Virgo",
"id": "VIRGO"
}
}
]
}
]
}
}
}
}
}
}
req = yield from _intent_req(alexa_client, data)
assert req.status == 200
data = yield from req.json()
text = data.get("response", {}).get("outputSpeech",
{}).get("text")
assert text == "You told us your sign is VIRGO."
@asyncio.coroutine
def test_intent_request_with_slots_and_name_resolution(alexa_client):
"""Test a request with slots and a name synonym."""