class_docstr: Unit tests for the huggingface LLM class
class_docstr_tok: ["Unit","tests","for","the","huggingface","LLM","class"]
code: def test_query_http_error_401(self, mocker, api_response_401):
      response_mock = mocker.Mock()
      response_mock.status_code = 401
      response_mock.json.return_value = api_response_401
      mocker.patch("requests.post", return_value=response_mock)
  
      llm = HuggingFaceLLM(api_token="test_token")
      payload = {"inputs": "Some input text"}
  
      with pytest.raises(LLMResponseHTTPError) as exc:
          llm.query(payload)
  
      assert api_response_401.get("error") in str(exc.value)
  
      requests.post.assert_called_once_with(
          llm._api_url,
          headers={"Authorization": "Bearer test_token"},
          json=payload,
          timeout=60,
      )
  
file_path: pandas-ai/tests/llms/test_base_hf.py
imports: import pytest
  import requests
  from pandasai.exceptions import LLMResponseHTTPError
  from pandasai.llm.base import HuggingFaceLLM
  from pandasai.prompts import AbstractPrompt
label_desc: Use image node_id 7 for calling the TestBaseHfLLM obj's underlying member method code with example usage: obj.test_query_http_error_401(mocker, api_response_401) without return types