summaryrefslogtreecommitdiff
path: root/debian/patches/fixtests-5d8cc71.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/fixtests-5d8cc71.patch')
-rw-r--r--debian/patches/fixtests-5d8cc71.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/patches/fixtests-5d8cc71.patch b/debian/patches/fixtests-5d8cc71.patch
new file mode 100644
index 0000000..065001d
--- /dev/null
+++ b/debian/patches/fixtests-5d8cc71.patch
@@ -0,0 +1,26 @@
+diff --git a/python/tests/utils.py b/python/tests/utils.py
+index 2e3c31e..b0963fc 100644
+--- a/python/tests/utils.py
++++ b/python/tests/utils.py
+@@ -5,6 +5,8 @@ import glob
+ import numpy as np
+ from tempfile import mkstemp
+
++DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav'
++
+ def array_from_text_file(filename, dtype = 'float'):
+ filename = os.path.join(os.path.dirname(__file__), filename)
+ with open(filename) as f:
+@@ -21,7 +23,11 @@ def get_default_test_sound(TestCase, rel_dir = 'sounds'):
+ if len(all_sounds) == 0:
+ TestCase.skipTest("please add some sounds in \'python/tests/sounds\'")
+ else:
+- return all_sounds[0]
++ default_sound = all_sounds[0]
++ if DEFAULT_SOUND in map(os.path.basename, all_sounds):
++ while os.path.basename(default_sound) != DEFAULT_SOUND:
++ default_sound = all_sounds.pop(0)
++ return default_sound
+
+ def get_tmp_sink_path():
+ fd, path = mkstemp()