Skip to content

Commit

Permalink
Merge pull request #535 from mgxd/fix/package-data
Browse files Browse the repository at this point in the history
FIX: sentinel path
  • Loading branch information
mgxd authored Jun 4, 2020
2 parents fe90598 + b61a865 commit 91bfb45
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ jobs:
docker run -u $( id -u ) -it --rm=false -w /src/niworkflows \
-e COVERAGE_FILE=/tmp/summaries/.pytest.coverage \
-e TEST_DATA_HOME=/data -v /tmp/data:/data \
-e FS_LICENSE=/etc/fslicense.txt \
-v /tmp/fslicense/license.txt:/etc/fslicense.txt:ro \
-v ${PWD}:/tmp niworkflows:latest \
pytest --junit-xml=/tmp/summaries/pytest.xml \
--cov niworkflows --cov-report xml:/tmp/summaries/unittests.xml \
Expand Down
16 changes: 16 additions & 0 deletions niworkflows/utils/tests/test_misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Test misc module."""
import os
import shutil
from unittest import mock

import pytest
Expand Down Expand Up @@ -30,3 +32,17 @@ def test_fs_license_check(stdout, rc, valid):
mocked_run.return_value.stdout = stdout
mocked_run.return_value.returncode = rc
assert check_valid_fs_license() is valid


@pytest.mark.skipif(not os.getenv("FS_LICENSE"), reason="No FS license found")
def test_fs_license_check2(monkeypatch):
"""Execute the canary itself."""
assert check_valid_fs_license() is True


@pytest.mark.skipif(shutil.which('mri_convert') is None, reason="FreeSurfer not installed")
def test_fs_license_check3(monkeypatch):
with monkeypatch.context() as m:
m.delenv("FS_LICENSE", raising=False)
m.delenv("FREESURFER_HOME", raising=False)
assert check_valid_fs_license() is False
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ console_scripts =
niworkflows =
data/*.txt
data/*.json
niworkflows/data/sentinel.nii.gz
data/sentinel.nii.gz
reports/default.yml
reports/report.tpl

Expand Down

0 comments on commit 91bfb45

Please sign in to comment.