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