python/test: added simple python unit test model
authorPaul Brossier <piem@piem.org>
Mon, 17 Sep 2007 00:34:13 +0000 (02:34 +0200)
committerPaul Brossier <piem@piem.org>
Mon, 17 Sep 2007 00:34:13 +0000 (02:34 +0200)
python/test/all_tests.py [new file with mode: 0755]
python/test/aubiomodule.py [new file with mode: 0644]

diff --git a/python/test/all_tests.py b/python/test/all_tests.py
new file mode 100755 (executable)
index 0000000..e0bb247
--- /dev/null
@@ -0,0 +1,15 @@
+#! /usr/bin/python
+
+# add ${src}/python and ${src}/python/aubio/.libs to python path
+# so the script is runnable from a compiled source tree.
+import sys, os
+sys.path.append('..')
+sys.path.append(os.path.join('..','aubio','.libs'))
+
+import unittest
+
+modules_to_test = ('aubiomodule')
+
+if __name__ == '__main__':
+  for module in modules_to_test: exec('from %s import *' % module)
+  unittest.main()
diff --git a/python/test/aubiomodule.py b/python/test/aubiomodule.py
new file mode 100644 (file)
index 0000000..cc2445c
--- /dev/null
@@ -0,0 +1,14 @@
+import unittest
+
+class aubiomodule_test_case(unittest.TestCase):
+
+  def test_aubio(self):
+    """ try importing aubio module """
+    import aubio 
+
+  def test_aubiowrapper(self):
+    """ try importing aubio.aubiowrapper module """
+    from aubio import aubiowrapper 
+if __name__ == '__main__':
+  unittest.main()