+++ /dev/null
-from test.test_support import findfile, TestFailed, import_module\r
-import unittest\r
-sunaudiodev = import_module('sunaudiodev', deprecated=True)\r
-import os\r
-\r
-try:\r
- audiodev = os.environ["AUDIODEV"]\r
-except KeyError:\r
- audiodev = "/dev/audio"\r
-\r
-if not os.path.exists(audiodev):\r
- raise unittest.SkipTest("no audio device found!")\r
-\r
-def play_sound_file(path):\r
- fp = open(path, 'r')\r
- data = fp.read()\r
- fp.close()\r
- try:\r
- a = sunaudiodev.open('w')\r
- except sunaudiodev.error, msg:\r
- raise TestFailed, msg\r
- else:\r
- a.write(data)\r
- a.close()\r
-\r
-\r
-def test_main():\r
- play_sound_file(findfile('audiotest.au'))\r
-\r
-\r
-\r
-if __name__ == '__main__':\r
- test_main()\r