예제 #1
0
    def test_iter_floats_decreasing(self):
        steps = Steps(7)
        values = list(steps.iter_floats(2.5, -1.0))

        self.assertEqual(values, [2.5, 2.0, 1.5, 1.0, 0.5, 0.0, -0.5, -1.0])
예제 #2
0
    def test_iter_floats_increasing(self):
        steps = Steps(3)
        values = list(steps.iter_floats(0.0, 1.0))

        self.assertEqual(values, [0.0, 1 / 3, 2 / 3, 1.0])