class_docstr: Test the WeaviateHook Hook.
class_docstr_tok: ["Test","the","WeaviateHook","Hook","."]
docstr: Test that if data_object is None or class_name is None, ValueError is raised.
docstr_tok: ["Test","that","if","data_object","is","None","or","class_name","is","None",",","ValueError","is","raised","."]
code: def test_create_of_get_or_create_object_raises_valueerror(
      self, weaviate_hook
  ):
      """
      Test that if data_object is None or class_name is None, ValueError is raised.
      """
      mock_client = MagicMock()
      weaviate_hook.get_conn = MagicMock(return_value=mock_client)
      weaviate_hook.get_object = MagicMock(return_value=None)
      mock_create_object = MagicMock()
      weaviate_hook.create_object = mock_create_object
      with pytest.raises(ValueError):
          weaviate_hook.get_or_create_object(
              data_object=None, class_name="TestClass"
          )
      with pytest.raises(ValueError):
          weaviate_hook.get_or_create_object(
              data_object={"name": "Test"}, class_name=None
          )
  
imports: from __future__ import annotations
  from contextlib import ExitStack
  from unittest import mock
  from unittest.mock import MagicMock, Mock
  import pandas
  import pytest
  import requests
  import weaviate
  from weaviate import ObjectAlreadyExistsException
  from airflow.models import Connection
  from airflow.providers.weaviate.hooks.weaviate import WeaviateHook
label_desc: Use image node_id 12 for calling the TestWeaviateHook obj's underlying member method code with example usage: obj.test_create_of_get_or_create_object_raises_valueerror(weaviate_hook) without return types