Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 5
0
 def test_int_range_unbounded_low(self):
     self.expect(valid.int_range(None, 10), 5)
Exemplo n.º 6
0
 def test_int_range_unbounded_high(self):
     self.expect(valid.int_range(0, None), 5)
Exemplo n.º 7
0
 def test_int_range_unbounded_high(self):
     self.expect(valid.int_range(0, None), 5)
Exemplo n.º 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'])
Exemplo n.º 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'"])
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 13
0
 def test_int_range_unbounded_low(self):
     self.expect(valid.int_range(None, 10), 5)
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 16
0
 def test_int_range(self):
     self.expect(valid.int_range(0, 10), 5)
Exemplo n.º 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'"])
Exemplo n.º 18
0
 def test_int_range(self):
     self.expect(valid.int_range(0, 10), 5)