Mercurial > cpython-lru_cache-weakref
view Lib/test/test_sunaudiodev.py @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | 57aed16e2165 |
| children | 0bd185c2e581 |
line wrap: on
line source
from test_support import verbose, TestFailed import sunaudiodev import os def findfile(file): if os.path.isabs(file): return file import sys for dn in sys.path: fn = os.path.join(dn, file) if os.path.exists(fn): return fn return file def play_sound_file(path): fp = open(path, 'r') data = fp.read() fp.close() try: a = sunaudiodev.open('w') except sunaudiodev.error, msg: raise TestFailed, msg else: a.write(data) a.close() def test(): play_sound_file(findfile('audiotest.au')) test()
