def testStartingNegative(self): expected = [-33] actual = euler.getIterativeSequence(-33) self.assertItemsEqual(expected, actual)
def testStartingOnOdd(self): expected = [39, 118, 59, 178, 89, 268, 134, 67, 202, 101, 304, 152, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1] actual = euler.getIterativeSequence(39) self.assertItemsEqual(expected, actual)
def testStartingOnZero(self): expected = [0] actual = euler.getIterativeSequence(0) self.assertItemsEqual(expected, actual)
def testStartingOnEven(self): expected = [50, 25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1] actual = euler.getIterativeSequence(50) self.assertItemsEqual(expected, actual)