Skip to content

Instantly share code, notes, and snippets.

@dtmilano
Last active December 16, 2017 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtmilano/8a106d33fb54677a71e5713289d62b23 to your computer and use it in GitHub Desktop.
Save dtmilano/8a106d33fb54677a71e5713289d62b23 to your computer and use it in GitHub Desktop.
lex-bot-tester sample: Data oriented approach
def test_conversations_text_book_car(self):
bot_name = 'BookTrip'
bot_alias = 'BookTripLatest'
user_id = 'ClientId'
conversation_definition = {
'BookCar': [
('reserve a car', DialogState.ELICIT_SLOT, {}),
('L.A.', DialogState.ELICIT_SLOT, {}),
('next week', DialogState.ELICIT_SLOT, {'PickUpDate': RE_WEEK}),
('a month from now', DialogState.ELICIT_SLOT, {'ReturnDate': RE_DATE}),
('25', DialogState.ELICIT_SLOT, {}),
('economy', DialogState.CONFIRM_INTENT, {}),
('yes', DialogState.READY_FOR_FULFILLMENT, {}),
],
'Cancel': [
('cancel', DialogState.READY_FOR_FULFILLMENT, {})
]
}
self.conversations_text_helper(bot_alias, bot_name, user_id, conversation_definition, verbose)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment