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

Method testResize

test/IECore/CompoundData.py:56–71  ·  view source on GitHub ↗

Test resizing

(self)

Source from the content-addressed store, hash-verified

54 self.assertEqual(v3.size(), 1)
55
56 def testResize(self):
57 """Test resizing"""
58 v = IECore.CompoundData()
59 v["0"] = IECore.FloatData(2)
60 self.assertEqual(v["0"], IECore.FloatData(2))
61 v["1"] = IECore.FloatData(0)
62 v["2"] = IECore.FloatData(3)
63 v["3"] = IECore.FloatData(2)
64 v["4"] = IECore.FloatData(5)
65 self.assertEqual(v["4"], IECore.FloatData(5))
66 self.assertEqual(len(v), 5)
67 del(v["0"])
68 self.assertEqual(len(v), 4)
69 self.assertTrue(v.has_key("0") == False)
70 v.clear()
71 self.assertEqual(len(v), 0)
72
73 def testAssignment(self):
74 """Test assignment"""

Callers

nothing calls this directly

Calls 4

CompoundDataMethod · 0.80
has_keyMethod · 0.80
lenFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected