def test_negative(self): ret = sm.add(-1, -3) self.assertEqual(ret, -4)
def test_add(): assert simplemath.add(5, 10) == 15
def test_string(self): ret = sm.add('a', 'b') self.assertEqual(ret, 'ab')
def test_add(self): ret = sm.add(1, 3) self.assertEqual(ret, 4)
#!/usr/bin/env python3 import simplemath from simplemath import mul, ALMOST_PI print(simplemath.add(1, 2)) print(mul(2, ALMOST_PI))
import nature.animals import simplemath d = nature.animals.Dog("Bob", "27") print(d.introduce()) d.age = nature.animals.pass_the_time(d.age, "10") print(d.introduce()) print(simplemath.add("5", "4"))
import simplemath print(simplemath.add(4,6)) print(simplemath.sub(4,6))
def test_add_neg_int(self): ret = sm.add(-1, -3) self.assertEqual(ret, -4)
def test_add_str(self): ret = sm.add("a", "b") self.assertEqual(ret, "ab")