Bump version to 1.0.
[python/dscho.git] / Lib / dos-8x3 / test_lin.py
blob4faaab12d24945d1282e25197d31711afda5a765
1 from test_support import verbose, findfile, TestFailed, TestSkipped
2 import linuxaudiodev
3 import errno
4 import os
6 def play_sound_file(path):
7 fp = open(path, 'r')
8 data = fp.read()
9 fp.close()
10 try:
11 a = linuxaudiodev.open('w')
12 except linuxaudiodev.error, msg:
13 if msg[0] in (errno.EACCES, errno.ENODEV):
14 raise TestSkipped, msg
15 raise TestFailed, msg
16 else:
17 a.write(data)
18 a.close()
20 def test():
21 play_sound_file(findfile('audiotest.au'))
23 test()