#!/usr/bin/env python # import required modules: # import os import sys import unittest class MyTest(unittest.TestCase): def test_upper(self): print "... testing test_upper" self.assertEqual('foo'.upper(), 'FOO') def test_isupper(self): print "... testing test_isupper" self.assertTrue('FOO'.isupper()) self.assertFalse('Foo'.isupper()) def test_split(self): print "... testing split" s = 'hello world' self.assertEqual(s.split(), ['hello', 'world']) # check that s.split fails when the separator is not a string with self.assertRaises(TypeError): s.split(2) if __name__ == '__main__': unittest.main()