<s> PKG = '<STR_LIT>' <EOL> import sys <EOL> import unittest <EOL> import rospy <EOL> import roslib <EOL> from rapp_platform_ros_communications . srv import ( <EOL> cognitiveTestsOfTypeSrv , <EOL> cognitiveTestsOfTypeSrvRequest , <EOL> cognitiveTestsOfTypeSrvResponse , <EOL> createCognitiveExerciseTestSrv , <EOL> createCognitiveExerciseTestSrvRequest , <EOL> createCognitiveExerciseTestSrvResponse , <EOL> recordUserPerformanceCognitiveTestsSrv , <EOL> recordUserPerformanceCognitiveTestsSrvRequest , <EOL> recordUserPerformanceCognitiveTestsSrvResponse , <EOL> userPerformanceCognitveTestsSrv , <EOL> userPerformanceCognitveTestsSrvRequest , <EOL> userPerformanceCognitveTestsSrvResponse <EOL> ) <EOL> class OntologyFunc ( unittest . TestCase ) : <EOL> def test_cognitive_tests_of_existent_type ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , cognitiveTestsOfTypeSrv ) <EOL> req = cognitiveTestsOfTypeSrvRequest ( ) <EOL> req . test_type = "<STR_LIT>" <EOL> req . test_language = "<STR_LIT>" <EOL> response = test_service ( req ) <EOL> prefix = '<STR_LIT>' <EOL> self . assertEqual ( prefix + '<STR_LIT>' in response . tests , True ) <EOL> self . assertEqual ( prefix + '<STR_LIT>' in response . tests , True ) <EOL> self . assertEqual ( response . success , True ) <EOL> def test_cognitive_tests_of_nonexistent_type ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , cognitiveTestsOfTypeSrv ) <EOL> req = cognitiveTestsOfTypeSrvRequest ( ) <EOL> req . test_type = "<STR_LIT>" <EOL> req . test_language = "<STR_LIT>" <EOL> response = test_service ( req ) <EOL> self . assertEqual ( response . success , False ) <EOL> self . assertEqual ( response . error , '<STR_LIT>' ) <EOL> def test_user_performance_existent_user_and_test ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , userPerformanceCognitveTestsSrv ) <EOL> req = userPerformanceCognitveTestsSrvRequest ( ) <EOL> req . ontology_alias = "<STR_LIT>" <EOL> req . test_type = "<STR_LIT>" <EOL> response = test_service ( req ) <EOL> self . assertEqual ( response . success , True ) <EOL> prefix = '<STR_LIT>' <EOL> self . assertEqual ( prefix + '<STR_LIT>' in response . tests , True ) <EOL> self . assertEqual ( prefix + '<STR_LIT>' in response . tests , True ) <EOL> def test_user_performance_nonexistent_user_and_test ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , userPerformanceCognitveTestsSrv ) <EOL> req = userPerformanceCognitveTestsSrvRequest ( ) <EOL> req . ontology_alias = "<STR_LIT>" <EOL> req . test_type = "<STR_LIT>" <EOL> response = test_service ( req ) <EOL> self . assertEqual ( response . success , False ) <EOL> self . assertEqual ( response . error , '<STR_LIT>' ) <EOL> def test_record_user_performance_nonexisting_test_and_user ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , recordUserPerformanceCognitiveTestsSrv ) <EOL> req = recordUserPerformanceCognitiveTestsSrvRequest ( ) <EOL> req . patient_ontology_alias = "<STR_LIT>" <EOL> req . test = "<STR_LIT>" <EOL> req . score = <NUM_LIT:1> <EOL> req . timestamp = <NUM_LIT:1> <EOL> response = test_service ( req ) <EOL> self . assertEqual ( response . success , False ) <EOL> self . assertEqual ( response . error , '<STR_LIT>' ) <EOL> def test_create_nonexistent_cognitive_test ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , createCognitiveExerciseTestSrv ) <EOL> req = createCognitiveExerciseTestSrvRequest ( ) <EOL> req . test_type = "<STR_LIT>" <EOL> req . test_difficulty = <NUM_LIT:1> <EOL> req . test_path = "<STR_LIT>" <EOL> req . test_subtype = "<STR_LIT>" <EOL> supportedLanguages = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> req . supported_languages = supportedLanguages <EOL> response = test_service ( req ) <EOL> self . assertEqual ( response . success , False ) <EOL> self . assertEqual ( response . error , '<STR_LIT>' ) <EOL> def test_create_nonexistent_cognitive_test_xml_path_nonexistent ( self ) : <EOL> subclasses_of_service = rospy . get_param ( "<STR_LIT>" ) <EOL> rospy . wait_for_service ( subclasses_of_service ) <EOL> test_service = rospy . ServiceProxy ( subclasses_of_service , createCognitiveExerciseTestSrv ) <EOL> req = createCognitiveExerciseTestSrvRequest ( ) <EOL> req . test_type = "<STR_LIT>" <EOL> req . test_difficulty = <NUM_LIT:1> <EOL> req . test_path = "<STR_LIT>" <EOL> req . test_subtype = "<STR_LIT>" <EOL> response = test_service ( req ) <EOL> self . assertEqual ( response . success , False ) <EOL> self . assertEqual ( response . error , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import rosunit <EOL> rosunit . unitrun ( PKG , '<STR_LIT>' , OntologyFunc ) </s>
