本文整理汇总了Python中val_description.InstanceFileHandler.InstanceFileHandler.getInstanceConfig方法的典型用法代码示例。如果您正苦于以下问题:Python InstanceFileHandler.getInstanceConfig方法的具体用法?Python InstanceFileHandler.getInstanceConfig怎么用?Python InstanceFileHandler.getInstanceConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类val_description.InstanceFileHandler.InstanceFileHandler
的用法示例。
在下文中一共展示了InstanceFileHandler.getInstanceConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testInstanceConfigDictionary
# 需要导入模块: from val_description.InstanceFileHandler import InstanceFileHandler [as 别名]
# 或者: from val_description.InstanceFileHandler.InstanceFileHandler import getInstanceConfig [as 别名]
def testInstanceConfigDictionary(self):
sampleInstanceFile = self.testDirectory + \
'/test_files/sample_instance.xml'
instanceFileHandler = InstanceFileHandler(sampleInstanceFile)
expectedConfigDictionary = {'/left_leg/ankle/actuator0': {'configFiles': ['v_e_001.xml', 'e.xml', 'e_sv.xml', 'testbench.xml',
'sensors.xml', 'safety.xml', 'mode.xml'], 'firmware': 'linear/turbo_bootloader.bin', 'type': 'turbodriver', 'location': '/left_leg/ankle/actuator0'}, '/left_leg/j1':
{'configFiles': ['v_a_001.xml', 'a.xml', 'a_sv.xml', 'testbench.xml', 'sensors.xml', 'safety.xml', 'mode.xml'], 'firmware':
'rotary/turbo_bootloader.bin', 'type': 'turbodriver', 'location': '/left_leg/j1'}, '/left_leg/ankle/actuator1': {'configFiles':
['v_e_002.xml', 'e.xml', 'e_sv.xml', 'testbench.xml',
'sensors.xml', 'safety.xml', 'mode.xml'],
'firmware': 'linear/turbo_bootloader.bin', 'type': 'turbodriver', 'location': '/left_leg/ankle/actuator1'}}
instanceConfig = instanceFileHandler.getInstanceConfig()
assert cmp(instanceConfig, expectedConfigDictionary) == 0
示例2: testInstanceConfigDictionary
# 需要导入模块: from val_description.InstanceFileHandler import InstanceFileHandler [as 别名]
# 或者: from val_description.InstanceFileHandler.InstanceFileHandler import getInstanceConfig [as 别名]
def testInstanceConfigDictionary(self):
sampleInstanceFile = self.testDirectory + \
'/test_files/sample_instance.xml'
instanceFileHandler = InstanceFileHandler(sampleInstanceFile)
instanceConfig = instanceFileHandler.getInstanceConfig()
# Check some of them, to many to check them all though.
assert('test_v_e_001.xml' in instanceConfig['/left_leg/ankle/actuator0']['configFiles'])
assert('test_e_futek_dh.xml' in instanceConfig['/left_leg/ankle/actuator0']['configFiles'])
assert('test_ankle_linear.xml' in instanceConfig['/left_leg/ankle/actuator0']['configFiles'])
assert('test_v_e_003.xml' in instanceConfig['/trunk/left_actuator']['configFiles'])
assert('test_e_renishaw_dh.xml' in instanceConfig['/trunk/left_actuator']['configFiles'])
assert('test_trunk_linear.xml' in instanceConfig['/trunk/left_actuator']['configFiles'])
assert('test_v_a_001.xml' in instanceConfig['/left_leg/j1']['configFiles'])