Beispiel #1
0
 def test_get_next_event_on_the_hour(self):
     test_event_datetime = datetime(2019, 9, 25, 19, 0, 0)
     self.assertEqual(
         speech.get_next_event("Annual Vision Evening",
                               test_event_datetime),
         "The next event is Annual Vision Evening on Wednesday 25 September at 7 PM. "
     )
Beispiel #2
0
def handle_get_next_event():
    reprompt_text = None
    should_end_session = True
    next_event = events.get_next_event()

    if not next_event:
        return utils.build_response(utils.build_speechlet_response(
            output=speech.NO_EVENTS_FOUND,
            reprompt_text=reprompt_text,
            should_end_session=should_end_session))

    return utils.build_response(utils.build_speechlet_response(
        output=speech.get_next_event(event_name=next_event['name'],
                                     event_datetime=next_event['datetime']),
        reprompt_text=reprompt_text,
        should_end_session=should_end_session,
        card_text=cards.get_next_event_content(
            event_description=next_event['description'],
            event_location_name=next_event['location_name']),
        card_title=cards.get_next_event_title(
            event_title=next_event['name'],
            event_datetime=next_event['datetime']),
        card_small_image_url=next_event['small_image_url'],
        card_large_image_url=next_event['large_image_url']))
Beispiel #3
0
 def test_get_next_event_morning(self):
     test_event_datetime = datetime(2016, 11, 13, 9, 14, 15)
     self.assertEqual(
         speech.get_next_event("Tasty breakfast!", test_event_datetime),
         "The next event is Tasty breakfast! on Sunday 13 November at 9:14. "
     )
Beispiel #4
0
 def test_get_next_event_evening(self):
     test_event_datetime = datetime(2019, 12, 23, 20, 15, 0)
     self.assertEqual(
         speech.get_next_event("Evening of fun", test_event_datetime),
         "The next event is Evening of fun on Monday 23 December at 8:15 in the evening. "
     )
Beispiel #5
0
 def test_get_next_event_afternoon(self):
     test_event_datetime = datetime(2019, 12, 23, 15, 21, 30)
     self.assertEqual(
         speech.get_next_event("Afternoon tea", test_event_datetime),
         "The next event is Afternoon tea on Monday 23 December at 3:21. ")