summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/test_sun.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-02 06:13:34 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-02 06:13:34 (GMT)
commit228b8e88bc7a7ce740e5c7326697e7c2256e099f (patch)
tree81149f4696131ea3d2c123fb169c8a31db23a76a /Lib/dos-8x3/test_sun.py
parentd69a84b01eb802b2bfd7dd2c868a9b2da9465a5e (diff)
downloadcpython-228b8e88bc7a7ce740e5c7326697e7c2256e099f.zip
cpython-228b8e88bc7a7ce740e5c7326697e7c2256e099f.tar.gz
cpython-228b8e88bc7a7ce740e5c7326697e7c2256e099f.tar.bz2
Whole lotta changes.
Diffstat (limited to 'Lib/dos-8x3/test_sun.py')
-rw-r--r--Lib/dos-8x3/test_sun.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/Lib/dos-8x3/test_sun.py b/Lib/dos-8x3/test_sun.py
new file mode 100644
index 0000000..aa85752
--- /dev/null
+++ b/Lib/dos-8x3/test_sun.py
@@ -0,0 +1,28 @@
+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()