def __init__(self, parent, prefix='pymsbayes-temp-'): """ Create TempFileSystem instance. `parent` must be an existing directory and will be were the base directory of the temp file system will be created. """ if not os.path.exists(parent): raise TempFSError('{0!r} does not exist; cannot create ' 'directory for temp files\n'.format(dest_dir)) if not os.path.isdir(parent): raise TempFSError('{0!r} is not a directory; cannot create ' 'directory for temp files\n'.format(dest_dir)) self.dirs= set() self.files = set() self.parent = self._get_full_path(parent) self.prefix = prefix self.base_dir = self._make_dir(parent=self.parent, prefix=self.prefix) self.token_id = random_str() self.deleted = False
def set_up(self): self.temp_fs = TempFileSystem(parent=package_paths.test_path(), prefix='PyMsBayesTestTemp-') self.test_id = 'pymsbayes-' + random_str()
def set_up(self): self.temp_fs = TempFileSystem( parent = package_paths.test_path(), prefix = 'PyMsBayesTestTemp-') self.test_id = 'pymsbayes-' + random_str()