Пример #1
0
 def test_float_min_max_fail(self):
     inputs = [2, 10, 33, 45.09]
     i = vals.Float(min_=datetime.datetime.now(), max_=datetime.datetime.now())
Пример #2
0
 def test_float_max_zero_fail(self):
     inputs = [15, 30.09]
     i = vals.Float(max_=0)
     for input in inputs:
         i(input)
Пример #3
0
 def test_float_max_type_fail(self):
     inputs = [15, 30.09]
     i = vals.Float(max_=datetime.datetime.now())
Пример #4
0
 def test_float_min_fail(self):
     inputs = [1, 30, 30.09]
     i = vals.Float(min_=40)
     for input in inputs:
         i(input)
Пример #5
0
 def test_float_min_zero_fail(self):
     inputs = [-1, -3.14]
     i = vals.Float(min_=0)
     for input in inputs:
         i(input)
Пример #6
0
 def test_float_min_type_fail(self):
     inputs = [1, 30, 30.09]
     i = vals.Float(min_=datetime.datetime.now())
Пример #7
0
 def test_float_fail(self):
     inputs = [{"blah":"foo"}, None, "1.a", datetime.datetime.now()]
     f = vals.Float()
     for input in inputs:
         f(input)
Пример #8
0
 def test_float_min_max(self):
     inputs = [2, 10, 29]
     i = vals.Float(min_=1, max_=30)
     for input in inputs:
         i(input)
Пример #9
0
 def test_float_max(self):
     inputs = [1, 30, 10, 15]
     i = vals.Float(max_=30)
     for input in inputs:
         i(input)
Пример #10
0
 def test_float(self):
     inputs = [1, 30, 30.09, "30.45"]
     f = vals.Float()
     for input in inputs:
         f(input)