def xdg_trinity_root(monkeypatch, tmpdir): """ Ensure proper test isolation as well as protecting the real directories. """ dir_path = tmpdir.mkdir('xdg_trinity_root') monkeypatch.setenv('XDG_TRINITY_ROOT', str(dir_path)) assert not is_under_path(XDG_DATA_HOME, get_xdg_trinity_root()) return str(dir_path)
def xdg_trinity_root(monkeypatch, tmpdir): """ Ensure proper test isolation as well as protecting the real directories. """ dir_path = tmpdir.mkdir('trinity') monkeypatch.setenv('XDG_TRINITY_ROOT', str(dir_path)) assert not is_under_path(os.path.expandvars('$HOME'), get_xdg_trinity_root()) return Path(str(dir_path))
def trinity_root_dir(self) -> Path: """ The trinity_root_dir is the base directory that all trinity data is stored under. The default ``data_dir`` path will be resolved relative to this directory. """ if self._trinity_root_dir is not None: return self._trinity_root_dir else: return get_xdg_trinity_root()