Add requirements

This commit is contained in:
Philip Rosenberg-Watt
2018-03-23 09:39:36 -06:00
parent 785f4cc251
commit f86a7ea36b
5 changed files with 12 additions and 6 deletions

View File

@@ -8,14 +8,14 @@ https://home-assistant.io/components/binary_sensor.google_calendar/
import logging
from datetime import timedelta
from httplib2 import ServerNotFoundError
from homeassistant.components.calendar import CalendarEventDevice
from homeassistant.components.google import (
CONF_CAL_ID, CONF_ENTITIES, CONF_TRACK, TOKEN_FILE,
GoogleCalendarService)
from homeassistant.util import Throttle, dt
REQUIREMENTS = ["httplib2==0.10.3"]
_LOGGER = logging.getLogger(__name__)
DEFAULT_GOOGLE_SEARCH_PARAMS = {
@@ -64,6 +64,8 @@ class GoogleCalendarData(object):
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Get the latest data."""
from httplib2 import ServerNotFoundError
try:
service = self.calendar_service.get()
except ServerNotFoundError:

View File

@@ -365,6 +365,7 @@ homematicip==0.8
http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a
# homeassistant.components.remember_the_milk
# homeassistant.components.calendar.google
httplib2==0.10.3
# homeassistant.components.sensor.dht

View File

@@ -83,6 +83,10 @@ holidays==0.9.4
# homeassistant.components.frontend
home-assistant-frontend==20180316.0
# homeassistant.components.remember_the_milk
# homeassistant.components.calendar.google
httplib2==0.10.3
# homeassistant.components.influxdb
# homeassistant.components.sensor.influxdb
influxdb==5.0.0
@@ -201,6 +205,3 @@ warrant==0.6.1
# homeassistant.components.sensor.yahoo_finance
yahoo-finance==1.4.0
# homeassistant.components.calendar.google
httplib2==0.10.3

View File

@@ -55,6 +55,7 @@ TEST_REQUIREMENTS = (
'hbmqtt',
'holidays',
'home-assistant-frontend',
'httplib2',
'influxdb',
'libpurecoollink',
'libsoundtouch',

View File

@@ -5,7 +5,6 @@ import unittest
from unittest.mock import patch, Mock
import pytest
from httplib2 import ServerNotFoundError
import homeassistant.components.calendar as calendar_base
import homeassistant.components.calendar.google as calendar
@@ -414,6 +413,8 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
def test_update_false(self):
"""Test that the update returns False upon Error."""
from httplib2 import ServerNotFoundError
mock_service = Mock()
mock_service.get = Mock(side_effect=ServerNotFoundError("unit test"))