def test_factory_cdsl_with_options(self): # TODO: Use a better cdsl example than this g = self.factory.from_file(os.path.join(RESOURCES_DIR, "componentwithoptions.cdsl")) ref = cf.ComponentFacade({ 'options': ['agmagent', 'innermodelviewer'], 'name': 'testcomp', 'imports': ['AGMCommonBehavior.idsl', 'AGMExecutive.idsl', 'AGMExecutiveTopic.idsl', 'AGMWorldModel.idsl'], 'recursiveImports': ['Planning.idsl'], 'language': 'cpp', 'statemachine_path': None, 'statemachine_visual': False, 'innermodelviewer': True, 'gui': ['Qt', 'QWidget'], 'rosInterfaces': [], 'iceInterfaces': [['AGMCommonBehavior', 'ice'], ['AGMExecutive', 'ice'], ['AGMExecutiveTopic', 'ice'], ['AGMWorldModel', 'ice']], 'implements': [['AGMCommonBehavior','ice']], 'requires': [['AGMExecutive', 'ice']], 'publishes': [], 'subscribesTo': [['AGMExecutiveTopic', 'ice']], 'usingROS': False, 'dsr': False, 'filename': os.path.join(RESOURCES_DIR, "componentwithoptions.cdsl")}) self.assertEqual(g, ref) # test for cached query h = self.factory.from_file(os.path.join(RESOURCES_DIR, "componentwithoptions.cdsl")) self.assertIs(g, h)
def test_factory_cdsl(self): # TODO: Use a better cdsl example than this g = self.factory.from_file(os.path.join(RESOURCES_DIR, "customstatemachinecpp.cdsl")) ref = cf.ComponentFacade({ 'options': [], 'name': 'testcomp', 'imports': [], 'recursiveImports': [], 'language': 'cpp', 'statemachine_path': 'gamestatemachine.smdsl', 'statemachine_visual': False, 'innermodelviewer': False, 'gui': ['Qt', 'QWidget'], 'rosInterfaces': [], 'iceInterfaces': [], 'implements': [], 'requires': [], 'publishes': [], 'subscribesTo': [], 'usingROS': False, 'dsr': False, 'filename': os.path.join(RESOURCES_DIR, "customstatemachinecpp.cdsl")}) self.assertEqual(g, ref) # test for cached query h = self.factory.from_file(os.path.join(RESOURCES_DIR, "customstatemachinecpp.cdsl")) self.assertIs(g, h)