Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e58b337

Browse files
committed
TEST: Check SurfaceDataFile retrieval
1 parent 962186f commit e58b337

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎nibabel/cifti2/tests/test_caretspec.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
from pathlib import Path
2+
import unittest
23

34
from nibabel.cifti2.caretspec import *
45

56
from nibabel.testing import data_path
7+
from nibabel.optpkg import optional_package
8+
9+
requests, has_requests, _ = optional_package('requests')
610

711

812
def test_CaretSpecFile():
@@ -16,3 +20,16 @@ def test_CaretSpecFile():
1620
assert isinstance(df, CaretSpecDataFile)
1721
if df.data_file_type == 'SURFACE':
1822
assert isinstance(df, SurfaceDataFile)
23+
24+
25+
@unittest.skipUnless(has_requests, reason="Test fetches from URL")
26+
def test_SurfaceDataFile():
27+
fsLR = CaretSpecFile.from_filename(Path(data_path) / "fsLR.wb.spec")
28+
df = fsLR.data_files[0]
29+
assert df.data_file_type == 'SURFACE'
30+
try:
31+
coords, triangles = df.get_mesh()
32+
except IOError:
33+
raise unittest.SkipTest(reason="Broken URL")
34+
assert coords.shape == (32492, 3)
35+
assert triangles.shape == (64980, 3)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /