assert_equal(c(None), None)
// this should always fail
c = Constraints(EnsureRange(min=0, max=4), EnsureRange(min=9, max=11))
self.assertRaises(ValueError, lambda: c(7.0))
def test_both(self):
// this should always work
c= AltConstraints(Constraints(EnsureFloat(),\
After Change
// this should always fail
c = Constraints(EnsureRange(min=0, max=4), EnsureRange(min=9, max=11))
assert_raises(ValueError, c, 7.0)
c = EnsureRange(min=0, max=4) | EnsureRange(min=9, max=11)
assert_equal(c(3.0), 3.0)
assert_equal(c(9.0), 9.0)
assert_raises(ValueError, c, 7.0)
assert_raises(ValueError, c, -1.0)