def test_func(self): x = hello.sum(1, 2) self.assertEqual(x, 3)
import hello #imports everything from hello.py file #from hello import sum print hello.sum(1, 78) print dir(hello)
def test_hello_sum(self): """ Test the sum function. """ self.assertEqual(hello.sum([1, 2, 3, 4]), 10)