Пример #1
0
 def test_timout_correct_return_value_int_0(self):
     """
     An input value of 0 should return 0.
     """
     self.assertEqual(get_timeout(0), 0)
Пример #2
0
 def test_timout_correct_return_value_int_1000(self):
     """
     An input value of 1000 should return 1.0.
     """
     self.assertEqual(get_timeout(1000), 1.0)
Пример #3
0
 def test_timout_correct_return_value_str_0(self):
     """
     An input value of "0" should return 0.
     """
     self.assertEqual(get_timeout("0"), 0)
Пример #4
0
 def test_timout_correct_return_value_str_1000(self):
     """
     An input value of "1000" should return 1.0.
     """
     self.assertEqual(get_timeout("1000"), 1.0)
Пример #5
0
 def test_timout_not_int(self):
     """
     Should fail because the timeout value is not an integer.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         get_timeout("hello")
Пример #6
0
 def test_timout_float_float(self):
     """
     Should fail because the timeout value is a float.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         get_timeout(2.0)
Пример #7
0
 def test_timout_too_small_int(self):
     """
     Should fail because the timeout value is too small.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         get_timeout(-2)
Пример #8
0
 def test_timout_too_large_int(self):
     """
     Should fail because the timeout value is too large.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         get_timeout(1073741824)