#NEWLINE# def test_camera_image_reauths_only_once( self ) : #NEWLINE# #INDENT# '"Test if the re-authentication only happens once.' #NEWLINE# self . uvc . _camera = mock . MagicMock ( ) #NEWLINE# self . uvc . _camera . get_snapshot . side_effect = camera . CameraAuthError #NEWLINE# with mock . patch . object ( self . uvc , '_login' ) as mock_login : #NEWLINE# #INDENT# self . assertRaises ( camera . CameraAuthError , self . uvc . camera_image ) #NEWLINE# mock_login . assert_called_once_with ( )