Skip to content

Commit

Permalink
fix: pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
levje committed Dec 12, 2024
1 parent e60f555 commit d78e0d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/tests/test_tractogram_filter_by_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ def test_execution_filtering(script_runner, monkeypatch):
ret = script_runner.run('scil_tractogram_filter_by_length.py',
in_bundle, 'bundle_4_filtered.trk',
'--minL', '125', '--maxL', '130')

sft = load_tractogram('bundle_4_filtered.trk', 'same')
assert len(sft) == 52

assert ret.success


def test_rejected_filtering(script_runner, monkeypatch):
monkeypatch.chdir(os.path.expanduser(tmp_dir.name))
in_bundle = os.path.join(SCILPY_HOME, 'filtering',
Expand All @@ -49,10 +50,11 @@ def test_rejected_filtering(script_runner, monkeypatch):

sft = load_tractogram('bundle_all_1mm_filtered.trk', 'same')
rejected_sft = load_tractogram('bundle_all_1mm_rejected.trk', 'same')

assert len(sft) == 266
assert len(rejected_sft) == 2824


def test_rejected_filtering_no_rejection(script_runner, monkeypatch):
monkeypatch.chdir(os.path.expanduser(tmp_dir.name))
in_bundle = os.path.join(SCILPY_HOME, 'filtering',
Expand All @@ -62,12 +64,12 @@ def test_rejected_filtering_no_rejection(script_runner, monkeypatch):
'--minL', '125', '--maxL', '130',
'--out_rejected', 'bundle_4_rejected.trk')
assert ret.success

# File should be created even though there are no rejected streamlines
assert os.path.exists('bundle_4_rejected.trk')

sft = load_tractogram('bundle_4_filtered.trk', 'same')
rejected_sft = load_tractogram('bundle_4_rejected.trk', 'same')

assert len(sft) == 52
assert len(rejected_sft) == 0

0 comments on commit d78e0d9

Please sign in to comment.