def test_labeltable(): img = GiftiImage() assert_equal(len(img.labeltable.labels), 0) new_table = GiftiLabelTable() new_table.labels += ['test', 'me'] img.labeltable = new_table assert_equal(len(img.labeltable.labels), 2)
def test_labeltable(): img = GiftiImage() assert_equal(len(img.labeltable.labels), 0) new_table = GiftiLabelTable() new_table.labels += ['test', 'me'] img.labeltable = new_table assert_equal(len(img.labeltable.labels), 2) # Test deprecations with clear_and_catch_warnings() as w: warnings.filterwarnings('always', category=DeprecationWarning) newer_table = GiftiLabelTable() newer_table.labels += ['test', 'me', 'again'] img.set_labeltable(newer_table) assert_equal(len(w), 1) assert_equal(len(img.get_labeltable().labels), 3) assert_equal(len(w), 2)