tests/templatetestdir/test.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import unittest
00004 
00005 import SyFi
00006 import sfc
00007 
00008 
00009 class MyTest(unittest.TestCase):
00010     def setUp(self):
00011         # initialize stuff
00012         #debug("setUp")
00013 
00014         print "Running templatetest in testdir"
00015         print "Imported SyFi from location", SyFi.__file__
00016         print "Imported sfc  from location", sfc.__file__
00017 
00018         self.foo = 1
00019     
00020     def tearDown(self):
00021         # delete initialized stuff
00022         #debug("tearDown")
00023         del self.foo
00024     
00025     def testSetup(self):
00026         # test initialized stuff
00027         #debug("testSetup")
00028         assert self.foo
00029     
00030     def testMyStuff(self):
00031         # test whatever meant by "MyStuff"
00032         #debug("testMyStuff")
00033         assert 1
00034     
00035     def testFailureExample(self):
00036         assert 1
00037         #assert 0 # uncomment to see how a failure looks like
00038 
00039 
00040 def test(verbosity=0):
00041     classes = [MyTest]
00042     suites = [unittest.makeSuite(c) for c in classes]
00043     testsuites = unittest.TestSuite(suites)
00044     unittest.TextTestRunner(verbosity=verbosity).run(testsuites)
00045 
00046 if __name__ == "__main__":
00047     test()
00048 

Generated on Mon Aug 31 16:16:49 2009 for SyFi by  doxygen 1.5.9