<s> import sys <EOL> import unittest <EOL> import roslib <EOL> import os <EOL> roslib . load_manifest ( "<STR_LIT>" ) <EOL> from rapp_speech_detection_sphinx4 import EnglishSupport <EOL> from rapp_speech_detection_sphinx4 import RappError <EOL> class TestAudioProcessing ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . english_support_module = EnglishSupport ( ) <EOL> def tearDown ( self ) : <EOL> self . utilities_module = None <EOL> def test_genericConfigurationFiles ( self ) : <EOL> conf = self . english_support_module . getGenericConfiguration ( ) <EOL> jar_path = conf [ '<STR_LIT>' ] <EOL> jar_path = jar_path . split ( '<STR_LIT::>' ) <EOL> self . assertEqual ( jar_path [ <NUM_LIT:0> ] , '<STR_LIT:.>' ) <EOL> self . assertEqual ( os . path . isfile ( jar_path [ <NUM_LIT:1> ] ) , True ) <EOL> self . assertEqual ( os . path . isdir ( jar_path [ <NUM_LIT:2> ] ) , True ) <EOL> conf_path = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isfile ( conf_path ) , True ) <EOL> acoustic = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isdir ( acoustic ) , True ) <EOL> grammar_folder = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isdir ( grammar_folder ) , True ) <EOL> dictionary = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isfile ( dictionary ) , True ) <EOL> language_model = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isfile ( language_model ) , True ) <EOL> def test_limitedVocabularyConfigurationFiles_correctCase ( self ) : <EOL> try : <EOL> conf = self . english_support_module . getLimitedVocebularyConfiguration ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:a>' , '<STR_LIT:test>' ] , [ ] , [ ] ) <EOL> except RappError as e : <EOL> self . assertEqual ( e . value , True ) <EOL> jar_path = conf [ '<STR_LIT>' ] <EOL> jar_path = jar_path . split ( '<STR_LIT::>' ) <EOL> self . assertEqual ( jar_path [ <NUM_LIT:0> ] , '<STR_LIT:.>' ) <EOL> self . assertEqual ( os . path . isfile ( jar_path [ <NUM_LIT:1> ] ) , True ) <EOL> self . assertEqual ( os . path . isdir ( jar_path [ <NUM_LIT:2> ] ) , True ) <EOL> conf_path = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isfile ( conf_path ) , True ) <EOL> acoustic = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isdir ( acoustic ) , True ) <EOL> grammar_folder = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isdir ( grammar_folder ) , True ) <EOL> dictionary = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isfile ( dictionary ) , True ) <EOL> language_model = conf [ '<STR_LIT>' ] <EOL> self . assertEqual ( os . path . isfile ( language_model ) , True ) <EOL> def test_limitedVocabularyConfigurationFiles_notExistentWords ( self ) : <EOL> try : <EOL> [ conf , success ] = self . english_support_module . getLimitedVocebularyConfiguration ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:a>' , '<STR_LIT:test>' ] , [ ] , [ ] ) <EOL> except RappError as e : <EOL> self . assertNotEqual ( e . value , '<STR_LIT>' ) <EOL> self . assertNotEqual ( e . value , True ) </s>
