Skip to content

Commit ba1d59c

Browse files
committed
audio_test wip #84
1 parent d54de4b commit ba1d59c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/audio_test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
self.assertTrue(True)
28+
29+
def test_hear(self):
30+
self.assertTrue(True)
31+

0 commit comments

Comments
 (0)