diff --git a/blinkpy.py b/blinkpy.py index f63caf1..531c6b2 100644 --- a/blinkpy.py +++ b/blinkpy.py @@ -27,7 +27,7 @@ def _attempt_reauthorization(blink): blink.set_links() return headers -def _request(blink, url=url, data=None, headers=None, reqtype='get', +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.""" if reqtype == 'post': diff --git a/tests/test_blink_functions.py b/tests/test_blink_functions.py index a4685e5..ef5d8be 100644 --- a/tests/test_blink_functions.py +++ b/tests/test_blink_functions.py @@ -122,7 +122,8 @@ class TestBlinkFunctions(unittest.TestCase): """Checks that the update function is doing the right thing.""" self.test_urls = blinkpy.BlinkURLHandler('test') test_config = mresp.FIRST_CAMERA - test_camera = blinkpy.blinkpy.BlinkCamera(test_config, self.test_urls) + self.urls = self.test_urls + test_camera = blinkpy.blinkpy.BlinkCamera(test_config, self) test_update = mresp.SECOND_CAMERA test_camera.update(test_update) test_image_url = self.test_urls.base_url + test_update['thumbnail'] diff --git a/tests/test_blink_system.py b/tests/test_blink_system.py index a67f362..b887405 100644 --- a/tests/test_blink_system.py +++ b/tests/test_blink_system.py @@ -47,7 +47,7 @@ class TestBlinkSetup(unittest.TestCase): self.blink_no_cred.get_auth_token() def test_no_auth_header(self): - """Check that we throw an excpetion when no auth header given.""" + """Check that we throw an excepetion when no auth header given.""" # pylint: disable=unused-variable (region_id, region), = mresp.LOGIN_RESPONSE['region'].items() self.blink.urls = blinkpy.BlinkURLHandler(region_id) @@ -79,7 +79,7 @@ class TestBlinkSetup(unittest.TestCase): with self.assertRaises(blinkpy.BlinkAuthenticationException): # pylint: disable=protected-access - blinkpy.blinkpy._request(None, reqtype='post') + blinkpy.blinkpy._request(None, reqtype='post', is_retry=True) @mock.patch('blinkpy.blinkpy.requests.post', side_effect=mresp.mocked_requests_post)