Пример #1
0
 def __config__(self):
     abstract_config = AbstractItem.__config__(self)
     meta_config = self.get_meta_data().__config__()
     relations_config = self.get_relations().__config__()
     config = merge_item_configs(abstract_config, meta_config)
     config = merge_item_configs(config, relations_config)
     return config        
Пример #2
0
 def test_merge_meta_config(self):
     meta_config = self.metaData.__config__()
     test_config = ConfigParser.ConfigParser()
     test_config.add_section('test')
     test_config.set('test', 'option', 'value')
     merged_config = merge_item_configs(meta_config, test_config)
     assert merged_config.has_section('meta')
     assert merged_config.has_option('meta', 'created_by')
     assert merged_config.get('meta', 'created_by') == 'rklinger'
     assert merged_config.has_section('test')
     assert merged_config.has_option('test', 'option')
     assert merged_config.get('test', 'option') == 'value'