[cig-commits] r13039 - cs/cigma/trunk/pysrc/tests

luis at geodynamics.org luis at geodynamics.org
Wed Oct 15 02:07:27 PDT 2008


Author: luis
Date: 2008-10-15 02:07:26 -0700 (Wed, 15 Oct 2008)
New Revision: 13039

Modified:
   cs/cigma/trunk/pysrc/tests/test_cigma.py
Log:
Added python unittest.TestCase for verifying the new bindings

Modified: cs/cigma/trunk/pysrc/tests/test_cigma.py
===================================================================
--- cs/cigma/trunk/pysrc/tests/test_cigma.py	2008-10-15 09:07:25 UTC (rev 13038)
+++ cs/cigma/trunk/pysrc/tests/test_cigma.py	2008-10-15 09:07:26 UTC (rev 13039)
@@ -1,2 +1,24 @@
 #!/usr/bin/env python
-import _cigma
+
+import unittest
+
+class tester_t(unittest.TestCase):
+    def __init__(self, *args):
+        unittest.TestCase.__init__(self, *args)
+    def test_one_plus_one(self):
+        self.failUnless(1 + 1 == 2)
+    def test_cigma_hello(self):
+        import _cigma
+        msg = _cigma.hello()
+        self.failUnless(msg == 'Hello World!')
+
+def create_suite():
+    suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(tester_t))
+    return suite
+
+def run_suite():
+    unittest.TextTestRunner(verbosity=2).run(create_suite())
+
+if __name__ == '__main__':
+    run_suite()



More information about the cig-commits mailing list