code: def test_save_wrong_mode(tmp_path):
      im = hopper()
      out = str(tmp_path / "temp.xbm")
  
      with pytest.raises(OSError):
          im.save(out)
  
file_path: pillow/Tests/test_file_xbm.py
imports: from __future__ import annotations
  from io import BytesIO
  import pytest
  from PIL import Image, XbmImagePlugin
  from .helper import hopper
label_desc: Use image node_id 5 for calling a global function with example usage: test_save_wrong_mode(tmp_path) without return types