Go to the documentation of this file.00001
00002
00003
00004
00005 import logging
00006 import unittest
00007
00008
00009 from nose.tools import raises
00010
00011
00012 from rospeex_core.ss import Factory
00013 from rospeex_core import exceptions as ext
00014
00015
00016 FORMAT = '[%(levelname)s] %(message)s @%(filename)s:%(funcName)s:%(lineno)d'
00017 logging.basicConfig(format=FORMAT, level=logging.DEBUG)
00018 logger = logging.getLogger(__name__)
00019
00020
00021 class TestSpeechSynthesisFactory(unittest.TestCase):
00022 def setUp(self):
00023 pass
00024
00025 @raises(ext.SpeechSynthesisException)
00026 def test_create_invelid_engine(self):
00027 Factory.create('hoge')
00028
00029 def test_create_valid_engine(self):
00030 for factory in Factory.ENGINE_FACTORY.keys():
00031 Factory.create(factory)
00032
00033
00034 if __name__ == '__main__':
00035 import rosunit
00036 test_class = TestSpeechSynthesisFactory
00037 rosunit.unitrun(
00038 'rospeex_core',
00039 'speech_synthesis_factory',
00040 test_class,
00041 None,
00042 coverage_packages=['rospeex.ss']
00043 )