code: def test_invalid_figure_json():
      # Do image export
      bad_fig = {"foo": "bar"}
      with pytest.raises(ValueError) as err:
          pio.to_image(bad_fig, format="png", engine="orca")
  
      assert "Invalid" in str(err.value)
  
      with pytest.raises(ValueError) as err:
          pio.to_image(
              bad_fig, format="png", validate=False, engine="orca"
          )
  
      assert (
          "The image request was rejected by the orca conversion utility"
          in str(err.value)
      )
  
      assert "400: invalid or malformed request syntax" in str(
          err.value
      )
  
imports: import plotly
  import plotly.io
  import plotly.graph_objs
  import os
  import shutil
  import pytest
  import sys
  import pandas
  from io import BytesIO
label_desc: Use image node_id 18 for calling a global function with example usage: test_invalid_figure_json() without return types