--- /dev/null
+import os
+import urllib
+
+def check_samples():
+ url = 'http://github.com/yomguy/timeside-samples/raw/master/samples/'
+ samples = ['guitar.wav', 'sweep.wav', 'sweep.flac', 'sweep.ogg', 'sweep.mp3', 'sweep_source.wav']
+ path = os.path.normpath(os.path.dirname(__file__))
+ dir = path + os.sep + 'samples'
+
+ if not os.path.exists(dir):
+ os.makedirs(dir)
+
+ for sample in samples:
+ path = dir + os.sep + sample
+ if not os.path.exists(path):
+ print 'downloading: ' + sample
+ f = open(path, 'w')
+ u = urllib.urlopen(url+sample)
+ f.write(u.read())
+ f.close()
# -*- coding: utf-8 -*-
import unittest
-import sys
+import os, sys
import time
+from tools import *
class TestCase(unittest.TestCase):
if arg: self.write(arg)
self.write('\n') # text-mode streams translate to \r\n if needed
+
class TestRunner:
"""A test runner class that displays results in textual form.
It prints out the names of tests as they are run, errors as they
occur, and a summary of the results at the end of the test run.
"""
+
def __init__(self, stream=sys.stderr, descriptions=1, verbosity=2):
self.stream = _WritelnDecorator(stream)
self.descriptions = descriptions
self.verbosity = verbosity
+ check_samples()
def _makeResult(self):
return _TextTestResult(self.stream, self.descriptions, self.verbosity)