async def test_webhook_camera_stream_stream_available_but_errors(hass, create_registrations, webhook_client):
    'Test fetching camera stream URLs for an HLS/stream-supporting camera but that streaming errors.'
    hass.states.async_set('camera.stream_camera', 'idle', {'supported_features': CAMERA_SUPPORT_STREAM})
    webhook_id = create_registrations[1]['webhook_id']
    with patch('homeassistant.components.camera.async_request_stream', side_effect=HomeAssistantError()):
        resp = (await webhook_client.post(f'/api/webhook/{webhook_id}', json={'type': 'stream_camera', 'data': {'camera_entity_id': 'camera.stream_camera'}}))
    assert (resp.status == 200)
    webhook_json = (await resp.json())
    assert (webhook_json['hls_path'] is None)
    assert (webhook_json['mjpeg_path'] == '/api/camera_proxy_stream/camera.stream_camera')
Test fetching camera stream URLs for an HLS/stream-supporting camera but that streaming errors.
async def test_webhook_camera_stream_stream_available_but_errors(hass, create_registrations, webhook_client):
    
    hass.states.async_set('camera.stream_camera', 'idle', {'supported_features': CAMERA_SUPPORT_STREAM})
    webhook_id = create_registrations[1]['webhook_id']
    with patch('homeassistant.components.camera.async_request_stream', side_effect=HomeAssistantError()):
        resp = (await webhook_client.post(f'/api/webhook/{webhook_id}', json={'type': 'stream_camera', 'data': {'camera_entity_id': 'camera.stream_camera'}}))
    assert (resp.status == 200)
    webhook_json = (await resp.json())
    assert (webhook_json['hls_path'] is None)
    assert (webhook_json['mjpeg_path'] == '/api/camera_proxy_stream/camera.stream_camera')