From 740e677452da7b0a30a2a9d4518e683a10219f0f Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Mon, 24 Jun 2019 19:07:37 +0930
Subject: [PATCH] TEST: fix gifti test

---
 tests/test_gifti.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/test_gifti.py b/tests/test_gifti.py
index 683863a8c..835655b1e 100644
--- a/tests/test_gifti.py
+++ b/tests/test_gifti.py
@@ -292,7 +292,7 @@ def test_GiftiMesh_multiple_vertices():
         TEST_VERTS * 10, intent='NIFTI_INTENT_POINTSET')
 
     gimg  = nib.gifti.GiftiImage(darrays=[verts1, verts2, tris])
-    gimg2 = nib.gifti.GiftiImage(darrays=[verts3])
+    gimg2 = nib.gifti.GiftiImage(darrays=[verts3, tris])
 
     with tempdir():
         fname  = op.abspath('test.gii')
@@ -302,18 +302,24 @@ def test_GiftiMesh_multiple_vertices():
 
         surf  = gifti.GiftiMesh(fname)
 
-        expvsets = [fname,
-                    '{}_1'.format(fname)]
+        expvsets = [fname, '{}_1'.format(fname)]
+
+        expbounds1 = np.min(verts1.data, axis=0), np.max(verts1.data, axis=0)
+        expbounds2 = np.min(verts2.data, axis=0), np.max(verts2.data, axis=0)
+        expbounds3 = np.min(verts3.data, axis=0), np.max(verts3.data, axis=0)
 
         assert np.all(surf.vertices == TEST_VERTS)
         assert np.all(surf.indices  == TEST_IDXS)
         assert  surf.vertexSets()   == expvsets
+        assert np.all(np.isclose(surf.bounds, expbounds1))
 
         surf.vertices = expvsets[1]
         assert np.all(surf.vertices == TEST_VERTS * 5)
+        assert np.all(np.isclose(surf.bounds, expbounds2))
 
         surf.loadVertices(fname2, select=True)
         assert np.all(surf.vertices == TEST_VERTS * 10)
+        assert np.all(np.isclose(surf.bounds, expbounds3))
 
 
 def test_GiftiMesh_needsFixing():
-- 
GitLab