code: def test_read_json_from_pathlib(fig1, fig_type_spec, fig_type):
      # Configure pathlib.Path-like mock
      filemock = MagicMock(spec=Path)
      filemock.read_text.return_value = pio.to_json(fig1)
  
      # read_json on mock file
      fig1_loaded = pio.read_json(filemock, output_type=fig_type_spec)
  
      # Check return type
      assert isinstance(fig1_loaded, fig_type)
  
      # Check loaded figure
      assert pio.to_json(fig1_loaded) == pio.to_json(fig1.to_dict())
  
imports: import plotly.graph_objs
  import plotly.io
  import pytest
  import plotly
  import json
  import os
  import tempfile
  from unittest.mock import MagicMock
  from pathlib import Path
label_desc: Use image node_id 12 for calling a global function with example usage: test_read_json_from_pathlib(fig1, fig_type_spec, fig_type) without return types