code: def test_kaleido_engine_write_image():
      for writeable_mock in make_writeable_mocks():
          with mocked_scope() as scope:
              pio.write_image(
                  fig, writeable_mock, engine="kaleido", validate=False
              )
  
          scope.transform.assert_called_with(
              fig,
              format=writeable_mock.expected_format,
              width=None,
              height=None,
              scale=None,
          )
  
          assert writeable_mock.active_write_function.call_count == 1
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_kaleido/test_kaleido.py
imports: import plotly.io
  import plotly.io.kaleido
  from contextlib import contextmanager
  from io import BytesIO
  from pathlib import Path
  from unittest.mock import Mock
label_desc: Use image node_id 6 for calling a global function with example usage: test_kaleido_engine_write_image() without return types