def test_plus_function_works_with_integers(self): # Arrange num1 = num2 = 2 expected_result = 4 # Act result = summa.plus(num1, num2) # Assert self.assertEqual(result, expected_result)
def test_negative_int_numbers_plus(self): result = laskin.plus(-2, -3) self.assertEqual(result, -5)
def test_int_numbers_plus(self): result = laskin.plus(2, 3) self.assertEqual(result, 5)
def test_error_if_not_numbers_plus(self): with self.assertRaises(TypeError): laskin.plus(1, "a")
def test_if_returns_integer_and_float_plus(self): result = laskin.plus(2, 3.2) self.assertEqual(result, 5.2)
def test_if_returns_floats_plus(self): result = laskin.plus(2.4, 3.2) self.assertEqual(result, 5.6)
def test_summa_neg(self): result = plus(-2, -3) self.assertEqual(result, -5)
def test_summa(self): result = plus(2, 3) self.assertEqual(result, 5)
def test_with_letters(self): with self.assertRaises(TypeError): plus("a", 0)
def test_floats(self): result = plus(3.4, 3.5) self.assertAlmostEqual(result, 6.9)