code: def test_bad_response_code(self, mock_get):
      mock_response = mock_get.return_value
      mock_response.status_code = 404
      mock_response.raise_for_status.side_effect = HTTPError
      ws = SearchApiWebSearch(api_key="api_key")
  
      with pytest.raises(SearchApiError):
          ws.run(query="Who is CEO of Microsoft?")
  
file_path: haystack/test/components/websearch/test_searchapi.py
imports: import os
  from unittest.mock import Mock, patch
  import pytest
  from requests import Timeout, RequestException, HTTPError
  from haystack import Document
  from haystack.components.websearch.searchapi import SearchApiError, SearchApiWebSearch
label_desc: Use image node_id 6 for calling the TestSearchApiSearchAPI obj's underlying member method code with example usage: obj.test_bad_response_code(mock_get) without return types