コード例 #1
0
 def test_e_power_x_zero_exp(self):
     "When the input is zero"
     obj_exp = ScientificCalc()
     self.assertEqual(obj_exp.exponential_func(0), 2.71828182846 ** 0)
コード例 #2
0
 def test_e_power_x_try_except(self):
     "Test case for try and except"
     obj_exp = ScientificCalc()
     self.assertEqual(obj_exp.exponential_func('accenture'),
                      "Please enter float or integer types input.")
コード例 #3
0
 def test_e_power_x_negative_exp(self):
     "When the input is negative integer"
     obj_exp = ScientificCalc()
     self.assertEqual(obj_exp.exponential_func(-2), 2.71828182846 ** -2)
コード例 #4
0
 def test_e_power_x_neg_decimal_exp(self):
     "When the input is negative decimal"
     obj_exp = ScientificCalc()
     self.assertEqual(obj_exp.exponential_func(-8.6), 2.71828182846 ** -8.6)