from simple_math import add, substract print(add(100, 50)) # output: 150 print(substract(100, 50)) # output: 50 # package code from my_package import utils utils.say_hello("LearnBATTA") # output: LearnBATTA
def test_add(self): expected = 5 result = simple_math.add(2, 3) self.assertEquals(result, expected)
def test_add(self): self.assertEqual(add(self.x, self.y), 2)
def test_add(self): # test the add function self.assertEqual(add(1,0), 1) self.assertEqual(add(3,4), 7) self.assertEqual(add(-1,1), 0) self.assertEqual(add(-3, 5), 2)
def test_one_and_one_fail(self): self.assertEqual(simple_math.add(1, 1), 4)
def test_one_and_one_fail_assert(self): assert simple_math.add(1,1) == 4
def test_one_and_one_fail_assert(self): assert simple_math.add(1, 1) == 4