Pass lint version bumps
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
python:
|
||||
enabled: true
|
||||
|
||||
fail_on_violations: true
|
||||
|
||||
@@ -11,6 +11,8 @@ matrix:
|
||||
env: TOXENV=py36
|
||||
- python: "3.6-dev"
|
||||
env: TOXENV=py36
|
||||
- python: "3.4.2"
|
||||
env: TOXENV=build
|
||||
|
||||
install: pip install -U tox coveralls
|
||||
language: python
|
||||
|
||||
@@ -3,6 +3,10 @@ Changelog
|
||||
|
||||
A list of changes between each release
|
||||
|
||||
0.7.0.dev (development version)
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
- Fixed style errors for bumped pydocstring and pylint versions
|
||||
|
||||
0.6.0 (2017-05-12)
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
- Removed redundent properties that only called hidden variables
|
||||
|
||||
+9
-8
@@ -31,7 +31,7 @@ def _attempt_reauthorization(blink):
|
||||
|
||||
def _request(blink, url='http://google.com', data=None, headers=None,
|
||||
reqtype='get', stream=False, json_resp=True, is_retry=False):
|
||||
"""Wrapper function for request."""
|
||||
"""Perform server requests and check if reauthorization neccessary."""
|
||||
if reqtype == 'post':
|
||||
response = requests.post(url, headers=headers,
|
||||
data=data)
|
||||
@@ -50,7 +50,7 @@ def _request(blink, url='http://google.com', data=None, headers=None,
|
||||
return _request(blink, url=url, data=data, headers=headers,
|
||||
reqtype=reqtype, stream=stream,
|
||||
json_resp=json_resp, is_retry=True)
|
||||
|
||||
# pylint: disable=no-else-return
|
||||
if json_resp:
|
||||
return response.json()
|
||||
else:
|
||||
@@ -114,12 +114,12 @@ class BlinkCamera(object):
|
||||
@property
|
||||
def battery_string(self):
|
||||
"""Return string indicating battery status."""
|
||||
status = "Unknown"
|
||||
if self.battery > 1 and self.battery <= 3:
|
||||
return "OK"
|
||||
status = "OK"
|
||||
elif self.battery >= 0:
|
||||
return "Low"
|
||||
else:
|
||||
return "Unknown"
|
||||
status = "Low"
|
||||
return status
|
||||
|
||||
def snap_picture(self):
|
||||
"""Take a picture with camera to create a new thumbnail."""
|
||||
@@ -302,9 +302,10 @@ class Blink(object):
|
||||
|
||||
def setup_system(self):
|
||||
"""
|
||||
Wrapper for various setup functions.
|
||||
Perform full system setup.
|
||||
|
||||
Method logs in and sets auth token, urls, and ids for future requests.
|
||||
Essentially this is just a wrapper function for ease of use.
|
||||
"""
|
||||
if self._username is None or self._password is None:
|
||||
raise BlinkAuthenticationException(ERROR.AUTHENTICATE)
|
||||
@@ -335,7 +336,7 @@ class Blink(object):
|
||||
})
|
||||
response = _request(self, url=LOGIN_URL, headers=headers,
|
||||
data=data, json_resp=False, reqtype='post')
|
||||
if response.status_code is 200:
|
||||
if response.status_code == 200:
|
||||
response = response.json()
|
||||
(self.region_id, self.region), = response['region'].items()
|
||||
else:
|
||||
|
||||
@@ -5,8 +5,8 @@ Generates constants for use in blinkpy
|
||||
import os
|
||||
|
||||
MAJOR_VERSION = 0
|
||||
MINOR_VERSION = 6
|
||||
PATCH_VERSION = 0
|
||||
MINOR_VERSION = 7
|
||||
PATCH_VERSION = '0.dev'
|
||||
|
||||
__version__ = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
|
||||
|
||||
|
||||
@@ -4,4 +4,5 @@ pylint==1.7.1
|
||||
pydocstyle==2.0.0
|
||||
pytest>=2.9.2
|
||||
pytest-cov>=2.3.1
|
||||
pytest-sugar>=0.8.0
|
||||
pytest-sugar>=0.8.0
|
||||
pytest-timeout>=1.0.0
|
||||
@@ -150,8 +150,10 @@ def mocked_requests_post(*args, **kwargs):
|
||||
return self.json_data
|
||||
|
||||
# pylint: disable=global-variable-not-assigned
|
||||
# pylint: disable=global-statement
|
||||
global RESPONSE
|
||||
# pylint: disable=global-variable-not-assigned
|
||||
# pylint: disable=global-statement
|
||||
global NETWORKS_RESPONSE
|
||||
|
||||
if args[0] is not None:
|
||||
@@ -260,6 +262,7 @@ def mocked_copyfileobj(*args, **kwargs):
|
||||
self.src = src
|
||||
self.dst = dst
|
||||
# pylint: disable=global-variable-not-assigned
|
||||
# pylint: disable=global-statement
|
||||
global FAKE_FILES
|
||||
mockobj = MockCopyFileObj(args[0], args[1])
|
||||
FAKE_FILES.append(mockobj.src)
|
||||
@@ -267,7 +270,7 @@ def mocked_copyfileobj(*args, **kwargs):
|
||||
|
||||
|
||||
def get_test_cameras(base_url):
|
||||
"""Helper function to return cameras named in this file."""
|
||||
"""Return cameras named in this file."""
|
||||
test_cameras = dict()
|
||||
for element in RESPONSE['devices']:
|
||||
if ('device_type' in element and
|
||||
@@ -285,7 +288,7 @@ def get_test_cameras(base_url):
|
||||
|
||||
|
||||
def get_test_id_table():
|
||||
"""Helper function to return mock id table."""
|
||||
"""Return mock id table."""
|
||||
test_id_table = dict()
|
||||
for element in RESPONSE['devices']:
|
||||
if ('device_type' in element and
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
"""
|
||||
Test all camera attributes.
|
||||
|
||||
Tests the camera initialization and attributes of
|
||||
individual BlinkCamera instantiations.
|
||||
individual BlinkCamera instantiations once the
|
||||
Blink system is set up.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
"""
|
||||
Test full system.
|
||||
|
||||
Tests the system initialization and attributes of
|
||||
the main Blink system. Tests if we properly catch
|
||||
any communication related errors at startup.
|
||||
@@ -136,7 +138,7 @@ class TestBlinkSetup(unittest.TestCase):
|
||||
@mock.patch('blinkpy.blinkpy.requests.get',
|
||||
side_effect=mresp.mocked_requests_get)
|
||||
def test_arm_disarm_system(self, mock_get, mock_post):
|
||||
"""Check that we can arm/disarm the system"""
|
||||
"""Check that we can arm/disarm the system."""
|
||||
self.blink.setup_system()
|
||||
self.blink.arm = False
|
||||
self.assertIs(self.blink.arm, False)
|
||||
|
||||
Reference in New Issue
Block a user