def testGoodRun(self): """Tests that if no bad values were found, sanity_check returns True""" self.cdl.slope = decimalize(1.2, 0.23, 2.487) self.cdl.offset = decimalize(-0.87, 0.987, 0.0) self.cdl.power = decimalize(2.97, 1.25, 1.0) self.cdl.sat = Decimal('2.9999') self.assertTrue(cdl_convert.sanity_check(self.cdl))
def testSaturation(self): """Tests that a bad sat value is reported""" self.cdl.sat = Decimal('3.01') self.assertFalse(cdl_convert.sanity_check(self.cdl)) self.assertEqual( 'The ColorCorrection "uniqueId" was given a Saturation value of ' '"3.01", which might be incorrect.\n', sys.stdout.getvalue())
def testGoodRun(self): """Tests that if no bad values were found, sanity_check returns True""" self.cdl.slope = decimalize(1.2, 0.23, 2.487) self.cdl.offset = decimalize(-0.87, 0.987, 0.0) self.cdl.power = decimalize(2.97, 1.25, 1.0) self.cdl.sat = Decimal('2.9999') self.assertTrue( cdl_convert.sanity_check(self.cdl) )
def testPower(self): """Tests that a bad slope value is reported""" self.cdl.power = decimalize(0.1, 3.1, 1.5) self.assertFalse(cdl_convert.sanity_check(self.cdl)) self.assertEqual( 'The ColorCorrection "uniqueId" was given a Power value of ' '"0.1", which might be incorrect.\n' 'The ColorCorrection "uniqueId" was given a Power value of ' '"3.1", which might be incorrect.\n', sys.stdout.getvalue())
def testOffset(self): """Tests that a bad slope value is reported""" self.cdl.offset = decimalize(-1.01, 1.5, 0.157) self.assertFalse(cdl_convert.sanity_check(self.cdl)) self.assertEqual( 'The ColorCorrection "uniqueId" was given a Offset value of ' '"-1.01", which might be incorrect.\n' 'The ColorCorrection "uniqueId" was given a Offset value of ' '"1.5", which might be incorrect.\n', sys.stdout.getvalue())
def testSaturation(self): """Tests that a bad sat value is reported""" self.cdl.sat = Decimal('3.01') self.assertFalse( cdl_convert.sanity_check(self.cdl) ) self.assertEqual( 'The ColorCorrection "uniqueId" was given a Saturation value of ' '"3.01", which might be incorrect.\n', sys.stdout.getvalue() )
def testPower(self): """Tests that a bad slope value is reported""" self.cdl.power = decimalize(0.1, 3.1, 1.5) self.assertFalse( cdl_convert.sanity_check(self.cdl) ) self.assertEqual( 'The ColorCorrection "uniqueId" was given a Power value of ' '"0.1", which might be incorrect.\n' 'The ColorCorrection "uniqueId" was given a Power value of ' '"3.1", which might be incorrect.\n', sys.stdout.getvalue() )
def testOffset(self): """Tests that a bad slope value is reported""" self.cdl.offset = decimalize(-1.01, 1.5, 0.157) self.assertFalse( cdl_convert.sanity_check(self.cdl) ) self.assertEqual( 'The ColorCorrection "uniqueId" was given a Offset value of ' '"-1.01", which might be incorrect.\n' 'The ColorCorrection "uniqueId" was given a Offset value of ' '"1.5", which might be incorrect.\n', sys.stdout.getvalue() )