test_sr_factory.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: utf-8 -*-
00003 
00004 # import python libraries
00005 import logging
00006 import unittest
00007 
00008 # import pypi libraries
00009 from nose.tools import raises
00010 
00011 # import local libraries
00012 from rospeex_core.sr import Factory
00013 from rospeex_core import exceptions as ext
00014 
00015 # setup logging
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 TestSpeechRecognitionFactory(unittest.TestCase):
00022     def setUp(self):
00023         pass
00024 
00025     @raises(ext.SpeechRecognitionException)
00026     def test_create_invalid_engine(self):
00027         Factory.create('hoge')
00028 
00029     def test_create_valid_engine(self):
00030         for engine in Factory.ENGINE_FACTORY.keys():
00031             Factory.create(engine)
00032 
00033 
00034 if __name__ == '__main__':
00035     import rosunit
00036     rosunit.unitrun(
00037         'rospeex_core',
00038         'speech_synthesis_factory',
00039         TestSpeechRecognitionFactory,
00040         None,
00041         coverage_packages=['rospeex_core.sr']
00042     )


rospeex_core
Author(s): Komei Sugiura
autogenerated on Thu Jun 6 2019 18:53:10