Upgrade ring_doorbell to 0.2.1 to fix oauth issues (#14984)

* Upgraded to ring_doorbell to 0.2.1 to fix oauth issues

* Updated unittest to cover Ring oauth
This commit is contained in:
Marcelo Moreira de Mello 2018-06-16 02:58:39 -04:00 committed by Martin Hjelmare
parent 2ec295a6f8
commit 2839f0ff5f
7 changed files with 17 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
REQUIREMENTS = ['ring_doorbell==0.1.8']
REQUIREMENTS = ['ring_doorbell==0.2.1']
_LOGGER = logging.getLogger(__name__)

View file

@ -1189,7 +1189,7 @@ restrictedpython==4.0b4
rflink==0.0.37
# homeassistant.components.ring
ring_doorbell==0.1.8
ring_doorbell==0.2.1
# homeassistant.components.notify.rocketchat
rocketchat-API==0.6.1

View file

@ -180,7 +180,7 @@ restrictedpython==4.0b4
rflink==0.0.37
# homeassistant.components.ring
ring_doorbell==0.1.8
ring_doorbell==0.2.1
# homeassistant.components.media_player.yamaha
rxv==0.5.1

View file

@ -44,6 +44,8 @@ class TestRingBinarySensorSetup(unittest.TestCase):
@requests_mock.Mocker()
def test_binary_sensor(self, mock):
"""Test the Ring sensor class and methods."""
mock.post('https://oauth.ring.com/oauth/token',
text=load_fixture('ring_oauth.json'))
mock.post('https://api.ring.com/clients_api/session',
text=load_fixture('ring_session.json'))
mock.get('https://api.ring.com/clients_api/ring_devices',

View file

@ -51,6 +51,8 @@ class TestRingSensorSetup(unittest.TestCase):
@requests_mock.Mocker()
def test_sensor(self, mock):
"""Test the Ring sensor class and methods."""
mock.post('https://oauth.ring.com/oauth/token',
text=load_fixture('ring_oauth.json'))
mock.post('https://api.ring.com/clients_api/session',
text=load_fixture('ring_session.json'))
mock.get('https://api.ring.com/clients_api/ring_devices',

View file

@ -42,6 +42,8 @@ class TestRing(unittest.TestCase):
@requests_mock.Mocker()
def test_setup(self, mock):
"""Test the setup."""
mock.post('https://oauth.ring.com/oauth/token',
text=load_fixture('ring_oauth.json'))
mock.post('https://api.ring.com/clients_api/session',
text=load_fixture('ring_session.json'))
response = ring.setup(self.hass, self.config)

8
tests/fixtures/ring_oauth.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"access_token": "eyJ0eWfvEQwqfJNKyQ9999",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "67695a26bdefc1ac8999",
"scope": "client",
"created_at": 1529099870
}