code: def test_new_file(self):
      def create(path):
          with open(path, "w") as f:
              f.write("test")
  
      creator = mock.Mock()
      creator.side_effect = create
      loader = mock.Mock()
  
      dir_path = tempfile.mkdtemp()
      # This file always does not exists as the directory is new.
      path = os.path.join(dir_path, "cahche")
  
      try:
          dataset.cache_or_load_file(path, creator, loader)
  
          self.assertEqual(creator.call_count, 1)
          self.assertFalse(loader.called)
  
          self.assertTrue(os.path.exists(path))
          with open(path) as f:
              self.assertEqual(f.read(), "test")
  
      finally:
          shutil.rmtree(dir_path)
  
imports: import os
  import shutil
  import tempfile
  import unittest
  import mock
  from chainer import dataset
  from chainer import testing
label_desc: Use image node_id 4 for calling the TestCacheOrLoadFile obj's underlying member method code with example usage: obj.test_new_file() without return types