@@ -181,22 +181,21 @@ def test_setup_backup_subdomain(self, mock_get, mock_post):
181
181
def test_continuous_bad_auth (self , mock_url , mock_get , mock_post ):
182
182
"""Check that we don't get stuck if we can't reauthorize."""
183
183
with self .assertRaises (blinkpy .BlinkAuthenticationException ):
184
- self .blink .setup_system ()
184
+ self .blink .setup_system ()
185
185
186
- '''
187
186
@mock .patch ('blinkpy.blinkpy.requests.post' ,
188
187
side_effect = mresp .mocked_requests_post )
189
188
@mock .patch ('blinkpy.blinkpy.requests.get' ,
190
189
side_effect = mresp .mocked_requests_get )
191
190
def test_reauthorization_attempt (self , mock_get , mock_post ):
192
191
"""Check that we can reauthorize after first unsuccessful attempt."""
193
192
self .blink .setup_system ()
194
- old_token = self.blink._token
195
- self.blink._token = 'BADTOKEN'
196
- (region_id, region), = mresp.LOGIN_RESPONSE['region'].items()
197
- test_urls = blinkpy.BlinkURLHandler(region_id)
198
- self.blink.urls.home_url = 'reauth'
199
- self.assertEqual(self.blink.refresh(), None )
200
- self.assertEqual(self. blink.urls.home_url, test_urls.home_url )
201
-
202
- '''
193
+ # pylint: disable=protected-access
194
+ original_header = self .blink ._auth_header
195
+ bad_header = { 'Host' : self . blink . _host , 'TOKEN_AUTH' : 'BADTOKEN' }
196
+ self . blink . _auth_header = bad_header
197
+ # pylint: disable=protected-access
198
+ self .assertEqual (self .blink ._auth_header , bad_header )
199
+ self .blink .get_summary ( )
200
+ # pylint: disable=protected-access
201
+ self . assertEqual ( self . blink . _auth_header , original_header )
0 commit comments