def test_multiply(self): a = 3 b = 4 self.assertEqual(a * b, my_math.multiply(a, b)) a = -4 b = 5 self.assertEqual(a * b, my_math.multiply(a, b)) a = 4 b = 0 self.assertEqual(a * b, my_math.multiply(a, b))
def test_python_ops(self): assert multiply(1, 2) == 2
def test_multiply_integers(self): result = my_math.multiply(1, 2) self.assertEqual(result, 2)
import my_math # Call C++ ops. print(my_math.add(1, 2)) print(my_math.subtract(1, 2)) # Call python op. print(my_math.multiply(1, 2))
def test_multiply_floats(self): result = my_math.multiply(2.0, 4.0) self.assertEqual(result, 8.0)
def test_multiply(): assert my_math.multiply(5, 2) == 10 assert my_math.multiply(3, 0) == 0 assert my_math.multiply(-1, -5) == 5
def test_multiply_int_and_string(self): result = my_math.multiply('trish', 3) self.assertEqual(result, 'trishtrishtrish')
def test_multiply(): assert my_math.multiply(3, 4) == 12 assert my_math.multiply(5, 2) == 10 assert my_math.multiply(7, 6) == 42
def test_multiply_floats(self): result = my_math.multiply(3.0, 1.5) self.assertEqual(result, 4.5)
import my_math age = my_math.add(30,5) height = my_math.subtract(78, 4) weight = my_math.multiply(90, 2) iq = my_math.divide(100, 2) print("Age: %d, height: %d, weight: %d, iq: %d" % (age, height, weight, id))