code: def test_app_state_not_connected(_):
      """Test an error message when a disconnected AppState tries to access attributes."""
      state = AppState(port=8000)
      with pytest.raises(
          AttributeError,
          match="Failed to connect and fetch the app state",
      ):
          _ = state.value
      with pytest.raises(
          AttributeError,
          match="Failed to connect and fetch the app state",
      ):
          state.value = 1
  
imports: import os
  from re import escape
  from unittest import mock
  import lightning.app
  import pytest
  import requests
  from lightning.app import LightningApp, LightningFlow, LightningWork
  from lightning.app.structures import Dict, List
  from lightning.app.utilities.app_helpers import AppStatePlugin, BaseStatePlugin
  from lightning.app.utilities.state import AppState
  from lightning_cloud.openapi import Externalv1LightningappInstance, V1LightningappInstanceStatus
label_desc: Use image node_id 1 for calling a global function with example usage: test_app_state_not_connected(_) without return types