test_speech_recognition.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 logging
00012 import unittest
00013 from nose.tools import eq_, raises
00014 
00015 
00016 from rospeex_core.sr.speech_recognition import SpeechRecognitionFactory
00017 from rospeex_core.exceptions import SpeechRecognitionException
00018 
00019 
00020 # set logging
00021 logger = logging.getLogger(__name__)
00022 logger.setLevel(logging.DEBUG)
00023 formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(filename)s:%(lineno)d:%(message)s')
00024 ch = logging.StreamHandler()
00025 ch.setFormatter(formatter)
00026 logger.addHandler(ch)
00027 
00028 
00029 class TestSpeechRecognitionFactory(unittest.TestCase):
00030     def setUp(self):
00031         pass
00032 
00033     @raises(SpeechRecognitionException)
00034     def test_create_invalid_engine(self):
00035         SpeechRecognitionFactory.create('hoge')
00036 
00037 
00038     def test_create_valid_engine(self):
00039         for engine in SpeechRecognitionFactory.ENGINE_FACTORY.keys():
00040             SpeechRecognitionFactory.create(engine)


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