Esempio n. 1
0
 def test_cleanup_file(self):
     """Verify os.remove is called by cleanup()."""
     from pygeoprocessing.testing.sampledata import cleanup
     with mock.patch('os.remove'):
         cleanup('/foo')
         self.assertTrue(os.remove.called)
Esempio n. 2
0
 def test_cleanup_dir(self):
     """Verify shutil.rmtree is called by cleanup()."""
     from pygeoprocessing.testing.sampledata import cleanup
     with mock.patch('shutil.rmtree'):
         cleanup('/')
         self.assertTrue(shutil.rmtree.called)