Example #1
0
 def testTimeoutCorrectReturnValueInt0(self):
     """
     An input value of 0 should return 0.
     """
     self.assertEqual(_get_timeout(0), 0)
Example #2
0
 def testTimeoutCorrectReturnValueInt1000(self):
     """
     An input value of 1000 should return 1.0.
     """
     self.assertEqual(_get_timeout(1000), 1.0)
Example #3
0
 def testTimeoutCorrectReturnValueStr0(self):
     """
     An input value of "0" should return 0.
     """
     self.assertEqual(_get_timeout("0"), 0)
Example #4
0
 def testTimeoutCorrectReturnValueStr1000(self):
     """
     An input value of "1000" should return 1.0.
     """
     self.assertEqual(_get_timeout("1000"), 1.0)
Example #5
0
 def testTimeoutNotInt(self):
     """
     Should fail because the timeout value is not an integer.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         _get_timeout("hello")
Example #6
0
 def testTimeoutFloatFloat(self):
     """
     Should fail because the timeout value is a float.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         _get_timeout(2.0)
Example #7
0
 def testTimeoutTooSmallInt(self):
     """
     Should fail because the timeout value is too small.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         _get_timeout(-2)
Example #8
0
 def testTimeoutTooLargeInt(self):
     """
     Should fail because the timeout value is too large.
     """
     with self.assertRaises(StratisCliEnvironmentError):
         _get_timeout(1073741824)