code: def test_broken_rwlock(tmp_path):
      dir_path = os.fspath(tmp_path)
      path = tmp_path / "rwlock"
  
      path.write_text('{"broken": "format"}', encoding="utf-8")
      with pytest.raises(RWLockFileFormatError):
          with _edit_rwlock(dir_path, localfs, False):
              pass
  
      path.write_text("{broken json", encoding="utf-8")
      with pytest.raises(RWLockFileCorruptedError):
          with _edit_rwlock(dir_path, localfs, False):
              pass
  
file_path: dvc/tests/unit/test_rwlock.py
imports: import json
  import os
  import pytest
  from dvc.fs import localfs
  from dvc.lock import LockError
  from dvc.rwlock import RWLockFileCorruptedError, RWLockFileFormatError, _edit_rwlock, rwlock
label_desc: Use image node_id 5 for calling a global function with example usage: test_broken_rwlock(tmp_path) without return types