Skip to content

Commit

Permalink
Fixed pylint and test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tchellomello committed Feb 11, 2019
1 parent a3854e9 commit 4e5059f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ring_doorbell/__init__.py
Expand Up @@ -191,7 +191,8 @@ def query(self,
elif method == 'PUT':
req = self.session.put((url), params=urlencode(params))
elif method == 'POST':
req = self.session.post((url), params=urlencode(params), json=json)
req = self.session.post(
(url), params=urlencode(params), json=json)

if self.debug:
_LOGGER.debug("_query %s ret %s", loop, req.status_code)
Expand Down
8 changes: 4 additions & 4 deletions ring_doorbell/doorbot.py
Expand Up @@ -4,8 +4,8 @@
import logging
from datetime import datetime
import os
import pytz
import time
import pytz


from ring_doorbell.generic import RingGeneric
Expand Down Expand Up @@ -355,9 +355,9 @@ def get_snapshot(self, retries=3, delay=1):
request_time = time.time()
for _ in range(retries):
time.sleep(delay)
response = self._ring.query(url, method="POST", json=payload,
raw=1).json()
response = self._ring.query(
url, method="POST", json=payload, raw=1).json()
if response["timestamps"][0]["timestamp"] / 1000 > request_time:
return self._ring.query(API_URI + SNAPSHOT_ENDPOINT.format(
self._attrs.get('id')), raw=True).content
self._attrs.get('id')), raw=True).content
return False
2 changes: 1 addition & 1 deletion tests/test_ring.py
Expand Up @@ -29,7 +29,7 @@ def test_basic_attributes(self, mock):
self.assertEqual(2, len(data.doorbells))
self.assertEqual(1, len(data.stickup_cams))
self.assertFalse(data._persist_token)
self.assertEquals('http://localhost/', data._push_token_notify_url)
self.assertEqual('http://localhost/', data._push_token_notify_url)

@requests_mock.Mocker()
def test_chime_attributes(self, mock):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ring_utils.py
Expand Up @@ -25,8 +25,8 @@ def tearDown(self):

def test_locator(self):
"""Test _locator method."""
self.assertEquals(-1, _locator([DATA], 'key', 'bar'))
self.assertEquals(0, _locator([DATA], 'key', 'value'))
self.assertEqual(-1, _locator([DATA], 'key', 'bar'))
self.assertEqual(0, _locator([DATA], 'key', 'value'))

def test_initiliaze_clean_cache(self):
"""Test _clean_cache method."""
Expand Down

0 comments on commit 4e5059f

Please sign in to comment.