code: def test_render_raises_before_save_mocked(
      tmp_path, mock_render, cls, kwargs, filename="dot.gv"
  ):
      args = [""] if cls.__name__ == "Source" else []
      dot = cls(*args, filename=filename, directory=tmp_path)
  
      expected_source = tmp_path / filename
      assert not expected_source.exists()
  
      first_arg = next(iter(kwargs))
      with pytest.raises(ValueError, match=f"unknown {first_arg}"):
          dot.render(**kwargs)
  
      assert not expected_source.exists()
  
imports: import locale
  import pathlib
  import re
  import subprocess
  import pytest
  import graphviz
  import _common
label_desc: Use image node_id 9 for calling a global function with example usage: test_render_raises_before_save_mocked(tmp_path, mock_render, cls, kwargs, filename) without return types