test_speech_synthesis.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: utf-8 -*-
00003 
00004 PKG_NAME = 'rospeex_core'
00005 
00006 try:
00007     import roslib; roslib.load_manifest(PKG_NAME)
00008 except:
00009     pass
00010 
00011 import os
00012 import logging
00013 import unittest
00014 from nose.tools import eq_, raises
00015 
00016 
00017 from rospeex_core.ss import SpeechSynthesisFactory
00018 from rospeex_core.exceptions import SpeechSynthesisException
00019 
00020 
00021 # set logging
00022 logger = logging.getLogger(__name__)
00023 logger.setLevel(logging.DEBUG)
00024 formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(filename)s:%(lineno)d:%(message)s')
00025 ch = logging.StreamHandler()
00026 ch.setFormatter(formatter)
00027 logger.addHandler(ch)
00028 
00029 
00030 class TestSpeechSynthesisFactory(unittest.TestCase):
00031     def setUp(self):
00032         pass
00033 
00034 
00035     @raises(SpeechSynthesisException)
00036     def test_create_invelid_engine(self):
00037         SpeechSynthesisFactory.create('hoge')
00038 
00039 
00040     def test_create_valid_engine(self):
00041         for factory in SpeechSynthesisFactory.ENGINE_FACTORY.keys():
00042             SpeechSynthesisFactory.create(factory)
00043 
00044 
00045 if __name__ == '__main__':
00046     import rosunit
00047     test_class = TestSpeechSynthesisFactory
00048     rosunit.unitrun(PKG_NAME, 'speech_synthesis_factory', test_class, None, coverage_packages=['rospeex.ss'])
00049 


rospeex_core
Author(s): Komei Sugiura
autogenerated on Wed Aug 26 2015 16:10:30