Esempio n. 1
0
    def test_get_calendar_info(self):
        """Test getting the calendar info."""
        calendar = {
            'id': '*****@*****.**',
            'etag': '"3584134138943410"',
            'timeZone': 'UTC',
            'accessRole': 'reader',
            'foregroundColor': '#000000',
            'selected': True,
            'kind': 'calendar#calendarListEntry',
            'backgroundColor': '#16a765',
            'description': 'Test Calendar',
            'summary': 'We are, we are, a... Test Calendar',
            'colorId': '8',
            'defaultReminders': [],
            'track': True
        }

        calendar_info = google.get_calendar_info(self.hass, calendar)
        self.assertEqual(
            calendar_info, {
                'cal_id':
                '*****@*****.**',
                'entities': [{
                    'device_id': 'we_are_we_are_a_test_calendar',
                    'name': 'We are, we are, a... Test Calendar',
                    'track': True,
                    'ignore_availability': True,
                }]
            })
Esempio n. 2
0
    def test_get_calendar_info(self):
        """Test getting the calendar info."""
        calendar = {
            'id': '*****@*****.**',
            'etag': '"3584134138943410"',
            'timeZone': 'UTC',
            'accessRole': 'reader',
            'foregroundColor': '#000000',
            'selected': True,
            'kind': 'calendar#calendarListEntry',
            'backgroundColor': '#16a765',
            'description': 'Test Calendar',
            'summary': 'We are, we are, a... Test Calendar',
            'colorId': '8',
            'defaultReminders': [],
            'track': True
        }

        calendar_info = google.get_calendar_info(self.hass, calendar)
        assert calendar_info == {
            'cal_id': '*****@*****.**',
            'entities': [{
                'device_id': 'we_are_we_are_a_test_calendar',
                'name': 'We are, we are, a... Test Calendar',
                'track': True,
                'ignore_availability': True,
            }]
        }