示例#1
0
 def test_calculate(self):
     dividend = 15
     divisor = 3
     expected_result = 5.0
     self.assertEqual(calculate(dividend, divisor), expected_result)
示例#2
0
 def test_zero_value(self):
     dividend = 0
     divisor = 3
     expected_result = 0.0
     self.assertEqual(calculate(dividend, divisor), expected_result)
示例#3
0
 def test_error_for_zero_devision(self):
     with self.assertRaises(ValueError):
         calculate(5, 0)
示例#4
0
 def test_nagative_values(self):
     dividend = 15
     divisor = -3
     expected_result = -5.0
     self.assertEqual(calculate(dividend, divisor), expected_result)