def testKnownValuesTupleToHex(self): """tupleToHex should give known result with known input""" for hex, tuple in self.knownValues: result = dColors.tupleToHex(tuple) self.assertEqual(result, hex)
def testSanity(self): """tuple = tupleToHex(colorTupleFromHex(tuple)) for range of valid input values""" #All inputs was way too many for run in range(1000): a, b, c = random.choice(range(256)), random.choice(range(256)), random.choice(range(256)) self.assertEqual((a,b,c), dColors.colorTupleFromHex(dColors.tupleToHex((a,b,c))))