From 1daf5d22afd25e8bf2e5dc3b4d2fc28d309a732c Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 25 Jan 2019 20:51:14 -0500 Subject: [PATCH] Fix lint, remove some camera tests --- blinkpy/camera.py | 2 -- blinkpy/sync_module.py | 1 - tests/test_cameras.py | 28 +--------------------------- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/blinkpy/camera.py b/blinkpy/camera.py index 7ffd64b..7991a91 100644 --- a/blinkpy/camera.py +++ b/blinkpy/camera.py @@ -6,8 +6,6 @@ from blinkpy import api _LOGGER = logging.getLogger(__name__) -MAX_CLIPS = 5 - class BlinkCamera(): """Class to initialize individual camera.""" diff --git a/blinkpy/sync_module.py b/blinkpy/sync_module.py index b62e73e..875a320 100644 --- a/blinkpy/sync_module.py +++ b/blinkpy/sync_module.py @@ -118,7 +118,6 @@ class BlinkSyncModule(): name = camera_config['name'] self.cameras[name].update(camera_config, force_cache=force_cache) - def check_new_videos(self): """Check if new videos since last refresh.""" resp = api.request_videos(self.blink, diff --git a/tests/test_cameras.py b/tests/test_cameras.py index a340228..6fa7c06 100644 --- a/tests/test_cameras.py +++ b/tests/test_cameras.py @@ -11,7 +11,7 @@ from unittest import mock from blinkpy import blinkpy from blinkpy.helpers.util import create_session, BlinkURLHandler from blinkpy.sync_module import BlinkSyncModule -from blinkpy.camera import BlinkCamera, MAX_CLIPS +from blinkpy.camera import BlinkCamera import tests.mock_responses as mresp USERNAME = 'foobar' @@ -55,32 +55,6 @@ class TestBlinkCameraSetup(unittest.TestCase): """Clean up after test.""" self.blink = None - def test_check_for_motion(self, mock_sess): - """Test check for motion function.""" - self.assertEqual(self.camera.last_record, []) - self.assertEqual(self.camera.motion_detected, None) - self.camera.sync.record_dates = {'foobar': [1, 3, 2, 4]} - self.camera.check_for_motion() - self.assertEqual(self.camera.last_record, [4]) - self.assertEqual(self.camera.motion_detected, False) - self.camera.sync.record_dates = {'foobar': [7, 1, 3, 4]} - self.camera.check_for_motion() - self.assertEqual(self.camera.last_record, [7, 4]) - self.assertEqual(self.camera.motion_detected, True) - self.camera.check_for_motion() - self.assertEqual(self.camera.last_record, [7, 4]) - self.assertEqual(self.camera.motion_detected, False) - - def test_max_motion_clips(self, mock_sess): - """Test that we only maintain certain number of records.""" - for i in range(0, MAX_CLIPS): - self.camera.last_record.append(i) - self.camera.sync.record_dates['foobar'] = [MAX_CLIPS+2] - self.assertEqual(len(self.camera.last_record), MAX_CLIPS) - self.camera.check_for_motion() - self.assertEqual(self.camera.motion_detected, True) - self.assertEqual(len(self.camera.last_record), MAX_CLIPS) - def test_camera_update(self, mock_sess): """Test that we can properly update camera properties.""" config = {