Remove thumbnail from homescreen method

This commit is contained in:
Kevin Fronczak
2019-06-17 10:20:23 -04:00
parent c2f44b3dfd
commit 8b7a491c89
2 changed files with 6 additions and 58 deletions
+1 -40
View File
@@ -99,45 +99,6 @@ class TestBlinkCameraSetup(unittest.TestCase):
self.assertEqual(self.camera.image_from_cache, 'test')
self.assertEqual(self.camera.video_from_cache, 'foobar')
def test_thumbnail_not_in_info(self, mock_sess):
"""Test that we grab thumbanil if not in camera_info."""
mock_sess.side_effect = [
mresp.MockResponse({'temp': 71}, 200),
'foobar',
'barfoo'
]
self.camera.last_record = ['1']
self.camera.sync.last_record = {
'new': {
'clip': '/test.mp4',
'time': '1970-01-01T00:00:00'
}
}
config = {
'name': 'new',
'id': 1234,
'network_id': 5678,
'serial': '12345678',
'enabled': False,
'battery_voltage': 90,
'battery_state': 'ok',
'temperature': 68,
'wifi_strength': 4,
'thumbnail': '',
}
self.camera.sync.homescreen = {
'devices': [
{'foo': 'bar'},
{'device_type': 'foobar'},
{'device_type': 'camera',
'name': 'new',
'thumbnail': '/new/thumb'}
]
}
self.camera.update(config)
self.assertEqual(self.camera.thumbnail,
'https://rest-test.immedia-semi.com/new/thumb.jpg')
def test_no_thumbnails(self, mock_sess):
"""Tests that thumbnail is 'None' if none found."""
mock_sess.return_value = 'foobar'
@@ -167,7 +128,7 @@ class TestBlinkCameraSetup(unittest.TestCase):
logrecord.output,
[("WARNING:blinkpy.camera:Could not retrieve calibrated "
"temperature."),
("ERROR:blinkpy.camera:Could not find thumbnail for camera new"
("WARNING:blinkpy.camera:Could not find thumbnail for camera new"
"\nNoneType: None")]
)