def test_setup_base_cache(self): cache_dir = WorkflowRunner._setup_base_cache() try: self.assertEqual(cache_dir, os.environ['XDG_CACHE_HOME']) except KeyError: self.assertEqual(cache_dir, os.path.join(os.environ['HOME'], '.cache/popper')) os.environ['POPPER_CACHE_DIR'] = '/tmp/popper' cache_dir = WorkflowRunner._setup_base_cache() self.assertEqual(cache_dir, '/tmp/popper') os.environ.pop('POPPER_CACHE_DIR')
def _setup_singularity_cache(self): self._singularity_cache = os.path.join( WorkflowRunner._setup_base_cache(), 'singularity', self._config.wid) if not os.path.exists(self._singularity_cache): os.makedirs(self._singularity_cache, exist_ok=True)