def test_float_range_above_max_centered(self): range = Range(.5, 2.5) self.assertEqual(2, range.normalize(3.5, zero_centered=True), 'Zero centered normalization failed')
def test_float_range_middle_centered(self): range = Range(.5, 2.5) self.assertEqual(0, range.normalize(1.5, zero_centered=True), 'Zero centered normalization failed')
def test_float_range_below_min_centered(self): range = Range(.5, 2.5) self.assertEqual(-2, range.normalize(-0.5, zero_centered=True), 'Zero centered normalization failed')
def test_float_range_above_max_not_centered(self): range = Range(.5, 2.5) self.assertEqual(1.5, range.normalize(3.5, zero_centered=False), 'Normalization failed')
def test_float_range_below_min_not_centered(self): range = Range(.5, 2.5) self.assertEqual(-0.5, range.normalize(-0.5, zero_centered=False), 'Normalization failed')
def test_int_range_above_max_centered(self): range = Range(1, 5) self.assertEqual(2, range.normalize(7, zero_centered=True), 'Zero centered normalization failed')
def test_int_range_below_min_centered(self): range = Range(1, 5) self.assertEqual(-2, range.normalize(-1, zero_centered=True), 'Zero centered normalization failed')
def test_int_range_middle_not_centered(self): range = Range(1, 5) self.assertEqual(.5, range.normalize(3, zero_centered=False), 'Normalization failed')