def test_camera_image_reauths(self):
        """"Test the re-authentication."""
        responses = [0]

        def fake_snapshot():
            try:
                responses.pop()
                raise camera.CameraAuthError()
            except __HOLE__:
                pass
            return 'image'

        self.uvc._camera = mock.MagicMock()
        self.uvc._camera.get_snapshot.side_effect = fake_snapshot
        with mock.patch.object(self.uvc, '_login') as mock_login:
            self.assertEqual('image', self.uvc.camera_image())
            mock_login.assert_called_once_with()
            self.assertEqual([], responses)
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/camera/test_uvc.py/TestUVC.test_camera_image_reauths