]> git.parisson.com Git - timeside.git/commitdiff
tests/api/test_lolevel.py: add option to pass a filename on the command line
authorPaul Brossier <piem@piem.org>
Thu, 18 Feb 2010 00:48:22 +0000 (00:48 +0000)
committerPaul Brossier <piem@piem.org>
Thu, 18 Feb 2010 00:48:22 +0000 (00:48 +0000)
tests/api/test_lolevel.py

index d2d75beff06344811be40264b8d27fccd939f7d9..8f34b93bfc43855e316f5e0a2b8c76308084576e 100644 (file)
@@ -1,7 +1,11 @@
 from timeside.tests.api import examples
 
-import os.path
-source= os.path.join (os.path.dirname(__file__),  "../samples/guitar.wav")
+import sys
+if len(sys.argv) > 1:
+    source = sys.argv[1]
+else:
+    import os.path
+    source= os.path.join (os.path.dirname(__file__),  "../samples/guitar.wav")
 
 Decoder = examples.FileDecoder
 print "Creating decoder with id=%s for: %s" % (Decoder.id(), source)