We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d54de4b commit ba1d59cCopy full SHA for ba1d59c
test/audio_test.py
@@ -0,0 +1,31 @@
1
+import unittest
2
+import os
3
+import test.pyaudio_mock
4
+
5
+import audio
6
7
+FILENAME = "test.wav"
8
9
+class AudioTest(unittest.TestCase):
10
+ def setUp(self):
11
+ piaudio.PyAudio = test.pyaudio_mock.PyAudioMock
12
+ self.audio = audio.Audio.get_instance()
13
14
+ def tearDown(self):
15
+ pass
16
17
+ def test_say(self):
18
+ self.audio.say("this is a test")
19
+ self.assertTrue(True)
20
21
+ def test_record_to_file(self):
22
+ self.audio.record_to_file(FILENAME, 3)
23
+ self.assertTrue(os.path.isfile(os.path.join(audio.SOUNDDIR, FILENAME)))
24
25
+ def test_play(self):
26
+ self.audio.play(FILENAME)
27
28
29
+ def test_hear(self):
30
31
0 commit comments