1 2 3 4 5 6 7 8 9 10 11
import foo import unittest class TestFoo(unittest.TestCase): def testFoo(self): self.assertEquals(foo.foo(), 6, 'foo() == 6') if __name__ == '__main__': unittest.main()