mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 13:15:18 +02:00
Add requirements
This commit is contained in:
@@ -8,14 +8,14 @@ https://home-assistant.io/components/binary_sensor.google_calendar/
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from httplib2 import ServerNotFoundError
|
|
||||||
|
|
||||||
from homeassistant.components.calendar import CalendarEventDevice
|
from homeassistant.components.calendar import CalendarEventDevice
|
||||||
from homeassistant.components.google import (
|
from homeassistant.components.google import (
|
||||||
CONF_CAL_ID, CONF_ENTITIES, CONF_TRACK, TOKEN_FILE,
|
CONF_CAL_ID, CONF_ENTITIES, CONF_TRACK, TOKEN_FILE,
|
||||||
GoogleCalendarService)
|
GoogleCalendarService)
|
||||||
from homeassistant.util import Throttle, dt
|
from homeassistant.util import Throttle, dt
|
||||||
|
|
||||||
|
REQUIREMENTS = ["httplib2==0.10.3"]
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_GOOGLE_SEARCH_PARAMS = {
|
DEFAULT_GOOGLE_SEARCH_PARAMS = {
|
||||||
@@ -64,6 +64,8 @@ class GoogleCalendarData(object):
|
|||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest data."""
|
"""Get the latest data."""
|
||||||
|
from httplib2 import ServerNotFoundError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
service = self.calendar_service.get()
|
service = self.calendar_service.get()
|
||||||
except ServerNotFoundError:
|
except ServerNotFoundError:
|
||||||
|
@@ -365,6 +365,7 @@ homematicip==0.8
|
|||||||
http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a
|
http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a
|
||||||
|
|
||||||
# homeassistant.components.remember_the_milk
|
# homeassistant.components.remember_the_milk
|
||||||
|
# homeassistant.components.calendar.google
|
||||||
httplib2==0.10.3
|
httplib2==0.10.3
|
||||||
|
|
||||||
# homeassistant.components.sensor.dht
|
# homeassistant.components.sensor.dht
|
||||||
|
@@ -83,6 +83,10 @@ holidays==0.9.4
|
|||||||
# homeassistant.components.frontend
|
# homeassistant.components.frontend
|
||||||
home-assistant-frontend==20180316.0
|
home-assistant-frontend==20180316.0
|
||||||
|
|
||||||
|
# homeassistant.components.remember_the_milk
|
||||||
|
# homeassistant.components.calendar.google
|
||||||
|
httplib2==0.10.3
|
||||||
|
|
||||||
# homeassistant.components.influxdb
|
# homeassistant.components.influxdb
|
||||||
# homeassistant.components.sensor.influxdb
|
# homeassistant.components.sensor.influxdb
|
||||||
influxdb==5.0.0
|
influxdb==5.0.0
|
||||||
@@ -201,6 +205,3 @@ warrant==0.6.1
|
|||||||
|
|
||||||
# homeassistant.components.sensor.yahoo_finance
|
# homeassistant.components.sensor.yahoo_finance
|
||||||
yahoo-finance==1.4.0
|
yahoo-finance==1.4.0
|
||||||
|
|
||||||
# homeassistant.components.calendar.google
|
|
||||||
httplib2==0.10.3
|
|
@@ -55,6 +55,7 @@ TEST_REQUIREMENTS = (
|
|||||||
'hbmqtt',
|
'hbmqtt',
|
||||||
'holidays',
|
'holidays',
|
||||||
'home-assistant-frontend',
|
'home-assistant-frontend',
|
||||||
|
'httplib2',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
'libpurecoollink',
|
'libpurecoollink',
|
||||||
'libsoundtouch',
|
'libsoundtouch',
|
||||||
|
@@ -5,7 +5,6 @@ import unittest
|
|||||||
from unittest.mock import patch, Mock
|
from unittest.mock import patch, Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from httplib2 import ServerNotFoundError
|
|
||||||
|
|
||||||
import homeassistant.components.calendar as calendar_base
|
import homeassistant.components.calendar as calendar_base
|
||||||
import homeassistant.components.calendar.google as calendar
|
import homeassistant.components.calendar.google as calendar
|
||||||
@@ -414,6 +413,8 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
|
|||||||
|
|
||||||
def test_update_false(self):
|
def test_update_false(self):
|
||||||
"""Test that the update returns False upon Error."""
|
"""Test that the update returns False upon Error."""
|
||||||
|
from httplib2 import ServerNotFoundError
|
||||||
|
|
||||||
mock_service = Mock()
|
mock_service = Mock()
|
||||||
mock_service.get = Mock(side_effect=ServerNotFoundError("unit test"))
|
mock_service.get = Mock(side_effect=ServerNotFoundError("unit test"))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user