|
4 | 4 |
|
5 | 5 | import numpy as np
|
6 | 6 |
|
7 |
| -from nibabel.gifti import giftiio |
| 7 | +from nibabel.gifti import (GiftiImage, GiftiDataArray, GiftiLabel, |
| 8 | + GiftiLabelTable, GiftiMetaData, giftiio) |
| 9 | +from nibabel.gifti.gifti import data_tag |
| 10 | +from nibabel.nifti1 import data_type_codes, intent_codes |
8 | 11 |
|
9 |
| -from .test_giftiio import (DATA_FILE1, DATA_FILE2, DATA_FILE3, DATA_FILE4, |
10 |
| - DATA_FILE5, DATA_FILE6) |
11 |
| -from ..gifti import (GiftiImage, GiftiDataArray, GiftiLabel, GiftiLabelTable, |
12 |
| - GiftiMetaData) |
13 |
| -from ...nifti1 import data_type_codes, intent_codes |
14 |
| -from ...testing import clear_and_catch_warnings |
15 | 12 | from numpy.testing import (assert_array_almost_equal,
|
16 | 13 | assert_array_equal)
|
17 | 14 | from nose.tools import (assert_true, assert_false, assert_equal, assert_raises)
|
| 15 | +from nibabel.testing import clear_and_catch_warnings |
| 16 | +from .test_giftiio import (DATA_FILE1, DATA_FILE2, DATA_FILE3, DATA_FILE4, |
| 17 | + DATA_FILE5, DATA_FILE6) |
18 | 18 |
|
19 | 19 |
|
20 | 20 | def test_gifti_image():
|
@@ -163,3 +163,11 @@ def assign_labeltable(val):
|
163 | 163 | def assign_metadata(val):
|
164 | 164 | img.meta = val
|
165 | 165 | assert_raises(TypeError, assign_metadata, 'not-a-meta')
|
| 166 | + |
| 167 | + |
| 168 | +def test_data_tag_deprecated(): |
| 169 | + img = GiftiImage() |
| 170 | + with clear_and_catch_warnings() as w: |
| 171 | + warnings.filterwarnings('once', category=DeprecationWarning) |
| 172 | + data_tag(np.array([]), 'ASCII', '%i', 1) |
| 173 | + assert_equal(len(w), 1) |
0 commit comments