Beispiel #1
0
 def test_int_range_invalid_range_high(self):
     self.expect_raises(valid.int_range(0, 10), 11, errors=['The value is not within the range 0 <= 11 <= 10'])
Beispiel #2
0
 def test_int_range_unbounded_low_too_high(self):
     self.expect_raises(valid.int_range(None, 10), 11, errors=['The value is not within the range None <= 11 <= 10'])
Beispiel #3
0
 def test_int_range_invalid_value(self):
     self.expect_raises(valid.int_range(0, 10), None, errors=['int_no_none does not accept None'])
Beispiel #4
0
 def test_int_range_unbounded_high_too_low(self):
     self.expect_raises(valid.int_range(0, None), -1, errors=['The value is not within the range 0 <= -1 <= None'])
Beispiel #5
0
 def test_int_range_unbounded_low(self):
     self.expect(valid.int_range(None, 10), 5)
Beispiel #6
0
 def test_int_range_unbounded_high(self):
     self.expect(valid.int_range(0, None), 5)
Beispiel #7
0
 def test_int_range_unbounded_high(self):
     self.expect(valid.int_range(0, None), 5)
Beispiel #8
0
 def test_int_range_invalid_range_coerce_low(self):
     self.expect_raises(valid.int_range(0, 10), '-1', errors=['The value is not within the range 0 <= -1 <= 10'])
Beispiel #9
0
 def test_int_range_invalid_range_invalid_data(self):
     self.expect_raises(valid.int_range(0, 10), 'a', errors=["invalid literal for int() with base 10: 'a'"])
Beispiel #10
0
 def test_int_range_invalid_value(self):
     self.expect_raises(valid.int_range(0, 10), None, errors=['int_no_none does not accept None'])
Beispiel #11
0
 def test_int_range_invalid_range_high(self):
     self.expect_raises(valid.int_range(0, 10), 11, errors=['The value is not within the range 0 <= 11 <= 10'])
Beispiel #12
0
 def test_int_range_unbounded_low_too_high(self):
     self.expect_raises(valid.int_range(None, 10), 11, errors=['The value is not within the range None <= 11 <= 10'])
Beispiel #13
0
 def test_int_range_unbounded_low(self):
     self.expect(valid.int_range(None, 10), 5)
Beispiel #14
0
 def test_int_range_unbounded_high_too_low(self):
     self.expect_raises(valid.int_range(0, None), -1, errors=['The value is not within the range 0 <= -1 <= None'])
Beispiel #15
0
 def test_int_range_invalid_range_coerce_low(self):
     self.expect_raises(valid.int_range(0, 10), '-1', errors=['The value is not within the range 0 <= -1 <= 10'])
Beispiel #16
0
 def test_int_range(self):
     self.expect(valid.int_range(0, 10), 5)
Beispiel #17
0
 def test_int_range_invalid_range_invalid_data(self):
     self.expect_raises(valid.int_range(0, 10), 'a', errors=["invalid literal for int() with base 10: 'a'"])
Beispiel #18
0
 def test_int_range(self):
     self.expect(valid.int_range(0, 10), 5)