MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / test_transform

Method test_transform

tests/python/LookTest.py:114–131  ·  view source on GitHub ↗

Test the setTransform() and getTransform() methods.

(self)

Source from the content-addressed store, hash-verified

112 self.look.getInterchangeAttribute('icc_profile_ name', 'should be rejected')
113
114 def test_transform(self):
115 """
116 Test the setTransform() and getTransform() methods.
117 """
118
119 # Default initialized transform value is None
120 self.assertIsNone(self.look.getTransform())
121
122 exp_tr = OCIO.ExponentTransform()
123 exp_tr.setValue(self.TEST_EXP_VALUES)
124 self.look.setTransform(exp_tr)
125 out_exp_tr = self.look.getTransform()
126 self.assertListEqual(out_exp_tr.getValue(), self.TEST_EXP_VALUES)
127
128 # Wrong type tests.
129 for invalid in (OCIO.ALLOCATION_UNIFORM, 1):
130 with self.assertRaises(TypeError):
131 self.look.setTransform(invalid)
132
133 def test_inverse_transform(self):
134 """

Callers

nothing calls this directly

Calls 5

setValueMethod · 0.95
ExponentTransformMethod · 0.80
getTransformMethod · 0.45
setTransformMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected