def test_int_or_none_range_invalid_range_invalid_data(self): self.expect_raises(valid.int_or_none_range(0, 10), 'a', errors=["invalid literal for int() with base 10: 'a'"])
def test_int_or_none_range_invalid_range_high(self): self.expect_raises(valid.int_or_none_range(0, 10), 11, errors=['The value is not within the range 0 <= 11 <= 10'])
def test_int_or_none_range_invalid_range_coerce_low(self): self.expect_raises(valid.int_or_none_range(0, 10), '-1', errors=['The value is not within the range 0 <= -1 <= 10'])
def test_int_or_none_range(self): self.expect(valid.int_or_none_range(0, 10), 5)
def test_int_or_none_range_invalid_value(self): self.expect(valid.int_or_none_range(0, 10), None)