shithub: aubio

Download patch

ref: 7280e6782f5f5ac3a666eda48e66d6c2d2537fa8
parent: 8802f92d197e4d76d4173ba25418240197099a1d
author: Paul Brossier <piem@piem.org>
date: Thu Oct 8 17:03:35 EDT 2009

tests/python/examples/aubiopitch.py: do not fail if file is missing, print out where to find it

--- a/tests/python/examples/aubiopitch.py
+++ b/tests/python/examples/aubiopitch.py
@@ -43,7 +43,8 @@
 
 class aubiopitch_test_yinfft(program_test_case):
 
-  filename = os.path.join('..','..','sounds','16568_acclivity_TwoCows.wav')
+  filename = os.path.join('..','..','sounds','16568__acclivity__TwoCows.wav')
+  url = "http://www.freesound.org/samplesViewSingle.php?id=16568"
   progname = "PYTHONPATH=../../python:../../python/aubio/.libs " + \
               os.path.join('..','..','python','aubiopitch')
   options  = " -m yinfft -t 0.75 "
@@ -50,6 +51,10 @@
 
   def test_aubiopitch(self):
     """ test aubiopitch with default parameters """
+    if not os.path.isfile(self.filename):
+      print "Warning: file 16568_acclivity_TwoCows.wav was not found in %s" % os.path.dirname(self.filename) 
+      print "download it from %s to actually run test" % url
+      return
     self.getOutput()
     expected_output = open(os.path.join('examples','aubiopitch','yinfft'+'.'+os.path.basename(self.filename)+'.txt')).read()
     lines = 0