def test_copy_3(self): # changes to clamping are isolated x = LinearScale().clamp(True) y = x.copy() x.clamp(False) self.assertEqual(x(2), 2) self.assertEqual(y(2), 1) self.assertTrue(y.clamp()) y.clamp(False) self.assertEqual(x(2), 2) self.assertEqual(y(2), 2) self.assertFalse(x.clamp())
def test_clamp_1(self): # defaults to false x = LinearScale() self.assertFalse(x.clamp()) self.assertAlmostEqual(x(-0.5), -0.5) self.assertAlmostEqual(x(1.5), 1.5)