code: def test_cleaning(remove, makedirs):
      # given
      resolved_path = MagicMock(
          spec=Path,
          exists=lambda: False,
      )
      file_path = MagicMock(
          spec=Path, resolve=lambda strict: resolved_path
      )
      data_path = MagicMock(
          spec=Path, __truediv__=lambda self, key: file_path
      )
  
      # when
      with MetadataFile(data_path=data_path) as metadata:
          # when
          metadata.cleanup()
  
          # then
          makedirs.assert_called_with(data_path, exist_ok=True)
          remove.assert_called_with(resolved_path)
  
imports: from pathlib import Path
  from mock import MagicMock, mock_open, patch
  from neptune.internal.metadata_file import MetadataFile
label_desc: Use image node_id 3 for calling a global function with example usage: test_cleaning(remove, makedirs) without return types