MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testUpdate

Method testUpdate

test/IECore/CompoundData.py:120–139  ·  view source on GitHub ↗

Test update function

(self)

Source from the content-addressed store, hash-verified

118 self.assertEqual(len(v1), 3)
119
120 def testUpdate(self):
121 """Test update function"""
122 v1 = IECore.CompoundData()
123 v1["0"] = IECore.FloatData(1.2)
124 v1["1"] = IECore.FloatData(2.3)
125 v1["2"] = IECore.FloatData(3)
126 v2 = IECore.CompoundData()
127 v2["0"] = IECore.UIntData(5)
128 v2["3"] = IECore.UIntData(6)
129 v2.update(v1)
130 self.assertEqual(len(v2), 4)
131 self.assertTrue(v2["0"] == IECore.FloatData(1.2))
132 self.assertTrue(v2["3"] == IECore.UIntData(6))
133 v3 = dict()
134 v3["1"] = IECore.CharData("a")
135 v3["4"] = IECore.UCharData(9)
136 v2.update(v3)
137 self.assertEqual(len(v2), 5)
138 self.assertTrue(v2["1"] == IECore.CharData("a"))
139 self.assertTrue(v2["4"] == IECore.UCharData(9))
140
141 def testSetDefault(self):
142 """Test setdefault function"""

Callers

nothing calls this directly

Calls 3

CompoundDataMethod · 0.80
lenFunction · 0.50
updateMethod · 0.45

Tested by

no test coverage detected