Skip to content

Commit 92d4b91

Browse files
committed
VDBObjectTest : Tweak for OpenVDB 10.1
The grid value class bindings are intended to provide everything both as an item (`["value"]`) and as an attribute (`.value`), but in OpenVDB 10.1 the item bindings seem broken, so we must use the attribute instead. Also added a missing import, and used `next()` to get the first element from `citerAllValues()`, knockin 2s off the runtime of the test.
1 parent 5ea2a9a commit 92d4b91

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/IECoreVDB/VDBObjectTest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
##########################################################################
3636

3737
import os
38+
import unittest
3839
import imath
3940

4041
import IECore
@@ -240,10 +241,10 @@ def incValue( value ) :
240241

241242
d = smoke.findGrid( "density" )
242243

243-
d2Value = list( d2.citerAllValues() )[0]
244-
dValue = list( d.citerAllValues() )[0]
244+
d2Value = next( d2.citerAllValues() )
245+
dValue = next( d.citerAllValues() )
245246

246-
self.assertEqual( d2Value['value'], dValue['value'] + 1 )
247+
self.assertEqual( d2Value.value, dValue.value + 1 )
247248

248249
# we've requested mutable grids from both vdb objects so they could have been edited.
249250
self.assertFalse( smoke.unmodifiedFromFile() )

0 commit comments

Comments
 (0)