code: def test_MockModule():
      mock = _MockModule("mocked_module")
      assert isinstance(mock.some_attr, _MockObject)
      assert isinstance(mock.some_method, _MockObject)
      assert isinstance(mock.attr1.attr2, _MockObject)
      assert isinstance(mock.attr1.attr2.meth(), _MockObject)
  
      assert repr(mock.some_attr) == "mocked_module.some_attr"
      assert repr(mock.some_method) == "mocked_module.some_method"
      assert repr(mock.attr1.attr2) == "mocked_module.attr1.attr2"
      assert (
          repr(mock.attr1.attr2.meth)
          == "mocked_module.attr1.attr2.meth"
      )
  
      assert repr(mock) == "mocked_module"
  
file_path: sphinx/tests/test_extensions/test_ext_autodoc_mock.py
imports: from __future__ import annotations
  import abc
  import sys
  from importlib import import_module
  from typing import TypeVar
  import pytest
  from sphinx.ext.autodoc.mock import _MockModule, _MockObject, ismock, mock, undecorate
label_desc: Use image node_id 1 for calling a global function with example usage: test_MockModule() without return types