Exemplo n.º 1
0
    def test_found_calendar(self):
        """Test when a calendar is found."""
        # 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
        # }

        # self.assertIsInstance(self.hass.data[google.DATA_INDEX], dict)
        # self.assertEqual(self.hass.data[google.DATA_INDEX], {})

        calendar_service = google.GoogleCalendarService(
            self.hass.config.path(google.TOKEN_FILE))
        assert google.setup_services(
            self.hass, {'google': {}}, True, calendar_service)
Exemplo n.º 2
0
    def test_found_calendar(self):
        """Test when a calendar is found."""
        # 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
        # }

        # self.assertIsInstance(self.hass.data[google.DATA_INDEX], dict)
        # self.assertEqual(self.hass.data[google.DATA_INDEX], {})

        calendar_service = google.GoogleCalendarService(
            self.hass.config.path(google.TOKEN_FILE))
        self.assertTrue(
            google.setup_services(self.hass, True, calendar_service))
Exemplo n.º 3
0
    def test_found_calendar(self):
        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
        }

        # self.assertIsInstance(self.hass.data[google.DATA_INDEX], dict)
        # self.assertEquals(self.hass.data[google.DATA_INDEX], {})

        calendar_service = google.GoogleCalendarService(
            self.hass.config.path(google.TOKEN_FILE))
        self.assertTrue(google.setup_services(self.hass, True,
                                              calendar_service))
        self.hass.services.call('google', 'found_calendar', calendar,
                                blocking=True)