tests/python/template.py: factorise
authorPaul Brossier <piem@piem.org>
Thu, 8 Oct 2009 02:24:19 +0000 (04:24 +0200)
committerPaul Brossier <piem@piem.org>
Thu, 8 Oct 2009 02:24:19 +0000 (04:24 +0200)
tests/python/examples/template.py [deleted file]
tests/python/template.py

diff --git a/tests/python/examples/template.py b/tests/python/examples/template.py
deleted file mode 100644 (file)
index a30e08e..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-import unittest
-from commands import getstatusoutput
-
-class program_test_case(unittest.TestCase):
-
-  filename = "/dev/null"
-  progname = "UNDEFINED"
-  command = ""
-  options = ""
-
-  def getOutput(self, expected_status = 0):
-    self.command = self.progname + ' -i ' + self.filename + self.command
-    self.command += self.options
-    [self.status, self.output] = getstatusoutput(self.command)
-    if expected_status != -1:
-      assert self.status == expected_status, \
-        "expected status was %s, got %s\nOutput was:\n%s" % \
-        (expected_status, self.status, self.output)
index 00e5344b9758011677712898dca7a7de3ca8dbdc..c0b1d126fa00195f34f99195664951b206ddb434 100644 (file)
@@ -1,4 +1,5 @@
 import unittest
+from commands import getstatusoutput
 from numpy import array
 
 class aubio_unit_template(unittest.TestCase):
@@ -18,6 +19,22 @@ class aubio_unit_template(unittest.TestCase):
         raise self.failureException, \
               (msg or '%r != %r within %r places' % (first, second, places))
 
+class program_test_case(unittest.TestCase):
+
+  filename = "/dev/null"
+  progname = "UNDEFINED"
+  command = ""
+  options = ""
+
+  def getOutput(self, expected_status = 0):
+    self.command = self.progname + ' -i ' + self.filename + self.command
+    self.command += self.options
+    [self.status, self.output] = getstatusoutput(self.command)
+    if expected_status != -1:
+      assert self.status == expected_status, \
+        "expected status was %s, got %s\nOutput was:\n%s" % \
+        (expected_status, self.status, self.output)
+
 def array_from_text_file(filename, dtype = 'float'):
   return array([line.split() for line in open(filename).readlines()], 
       dtype = dtype)