Example #1
0
 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'"])
Example #2
0
 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'])
Example #3
0
 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'])
Example #4
0
 def test_int_or_none_range(self):
     self.expect(valid.int_or_none_range(0, 10), 5)
Example #5
0
 def test_int_or_none_range_invalid_value(self):
     self.expect(valid.int_or_none_range(0, 10), None)
Example #6
0
 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'"])
Example #7
0
 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'])
Example #8
0
 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'])
Example #9
0
 def test_int_or_none_range_invalid_value(self):
     self.expect(valid.int_or_none_range(0, 10), None)
Example #10
0
 def test_int_or_none_range(self):
     self.expect(valid.int_or_none_range(0, 10), 5)