def test_division_by_zero(self): num1 = 10 num2 = 0 try: math.addition(num1, num2) except ZeroDivisionError: assert True except: assert False
def test_division_mix_numbers(self): num1 = -12 num2 = 3 result = math.addition(num1, num2) self.assertEquals(result, -9, "Is expected to have a result equal to -9.")
def test_addition_mix_numbers(self): num1 = -2 num2 = 3 result = math.addition(num1, num2) self.assertEquals(result, 1, "Is expected to have a result equal to 1.")
def test_addition_positive_numbers(self): num1 = 2 num2 = 3 result = math.addition(num1, num2) self.assertEquals(result, 5, "Is expected to have a result equal to 5.")
def test_addition_negative_numbers(self): num1 = -10 num2 = -4 result = math.addition(num1, num2) self.assertEquals(result, -14, "Is expected to have a result equal to -14.")