code: def test_write_json_pathlib(fig1, pretty, remove_uids):
      # Configure file-like mock
      filemock = MagicMock(spec=Path)
  
      # write_json to mock file
      pio.write_json(
          fig1, filemock, pretty=pretty, remove_uids=remove_uids
      )
  
      # check write contents
      expected = pio.to_json(
          fig1, pretty=pretty, remove_uids=remove_uids
      )
      filemock.write_text.assert_called_once_with(expected)
  
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 15 for calling a global function with example usage: test_write_json_pathlib(fig1, pretty, remove_uids) without return types