'Test that we can create an event trigger on device.'

@patch('homeassistant.components.calendar.google.GoogleCalendarData')
def test_future_event(self, mock_next_event):

    one_hour_from_now = (dt_util.now() + dt_util.dt.timedelta(minutes=30))
    event = {'start': {'dateTime': one_hour_from_now.isoformat()}, 'end': {'dateTime': (one_hour_from_now + dt_util.dt.timedelta(minutes=60)).isoformat()}, 'summary': 'Test    Event    in    30    minutes', 'reminders': {'useDefault': True}, 'id': 'aioehgni435lihje', 'status': 'confirmed', 'updated': '2016-11-05T15:52:07.329Z', 'organizer': {'email': 'uvrttabwegnui4gtia3vyqb@import.calendar.google.com', 'displayName': 'Organizer    Name', 'self': True}, 'created': '2016-11-05T15:52:07.000Z', 'iCalUID': 'dsfohuygtfvgbhnuju@google.com', 'sequence': 0, 'creator': {'email': 'uvrttabwegnui4gtia3vyqb@import.calendar.google.com', 'displayName': 'Organizer    Name'}, 'etag': '"2956722254658000"', 'kind': 'calendar#event', 'htmlLink': 'https://www.google.com/calendar/event?eid=*******'}
    mock_next_event.return_value.event = event
    device_name = 'Test    Future    Event'
    device_id = 'test_future_event'
    cal = calendar.GoogleCalendarEventDevice(self.hass, None, device_id, {'name': device_name})
    self.assertEqual(cal.name, device_name)
    self.assertEqual(cal.state, STATE_OFF)
    self.assertFalse(cal.offset_reached())
    self.assertEqual(cal.device_state_attributes, {'message': event['summary'], 'all_day': False, 'offset_reached': False, 'start_time': one_hour_from_now.strftime(DATE_STR_FORMAT), 'end_time': (one_hour_from_now + dt_util.dt.timedelta(minutes=60)).strftime(DATE_STR_FORMAT), 'location': '', 'description': ''})
