History

tests/test_{source,sink}.py: add sink, improve source, use sounds in python/tests/sounds

Paul Brossier committed 13 years ago

Commit e1bfde51 parent 143cc433 files · +104 −21Browse files

Showing the changes to python/tests/utils.py (1 of 3 files). Show all

Unified · Split

python/tests/utils.py+9−5
@@ -1,9 +1,13 @@
11 #! /usr/bin/env python
22
33 def array_from_text_file(filename, dtype = 'float'):
4− import os.path
5− from numpy import array
6− filename = os.path.join(os.path.dirname(__file__), filename)
7− return array([line.split() for line in open(filename).readlines()],
8− dtype = dtype)
4+ import os.path
5+ from numpy import array
6+ filename = os.path.join(os.path.dirname(__file__), filename)
7+ return array([line.split() for line in open(filename).readlines()],
8+ dtype = dtype)
99
10+def list_all_sounds(rel_dir):
11+ import os.path, glob
12+ datadir = os.path.join(os.path.dirname(__file__), rel_dir)
13+ return glob.glob(os.path.join(datadir,'*.*'))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t