-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtest.py
27 lines (19 loc) · 846 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
import festival
class FestivalTest(unittest.TestCase):
def test_say_file(self):
# test wrapper
self.assertTrue(festival.sayFile("tests/test_file.txt"))
self.assertRaises(ValueError, festival.sayFile, "invalid_file.extension")
# test C module
self.assertTrue(festival._festival.sayFile("tests/test_file.txt"))
self.assertFalse(festival._festival.sayFile("invalid_file.extension"))
def test_say_text(self):
self.assertTrue(festival.sayText("test one"))
self.assertTrue(festival._festival._sayText("test two"))
def test_eval_command(self):
self.assertTrue(festival.execCommand("(SayText \"test command\")"))
def test_set_stretch(self):
self.assertTrue(festival.setStretchFactor(1))
if __name__ == '__main__':
unittest.main()