forked from templateflow/python-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pathlib import Path | ||
from .. import conf, api | ||
|
||
|
||
def test_update_s3(tmp_path): | ||
conf.TF_HOME = tmp_path / 'templateflow' | ||
conf.TF_HOME.mkdir(exist_ok=True) | ||
|
||
# replace TF_SKEL_URL with the path of a legacy skeleton | ||
_skel_url = conf._s3.TF_SKEL_URL | ||
conf._s3.TF_SKEL_URL = ( | ||
"https://github.com/templateflow/python-client/raw/0.5.0/" | ||
"templateflow/conf/templateflow-skel.{ext}".format | ||
) | ||
# initialize templateflow home, making sure to pull the legacy skeleton | ||
conf.update(local=False) | ||
# ensure we can grab a file | ||
assert Path(api.get('MNI152NLin2009cAsym', resolution=2, desc='brain', suffix='mask')).exists() | ||
# and ensure we can't fetch one that doesn't yet exist | ||
assert not api.get('Fischer344', hemi='L', desc='brain', suffix='mask') | ||
|
||
# refresh the skeleton using the most recent skeleton | ||
conf._s3.TF_SKEL_URL = _skel_url | ||
conf.update(local=True, overwrite=True) | ||
assert Path(api.get('Fischer344', hemi='L', desc='brain', suffix='mask')).exists() |