+ # Case Insensitive matching
+ tci_attributes = {'oneNameone': 'onevalueone',
+ 'onenamEtwo': 'onevaluetwo',
+ 'Two': {'twonameone': 'twovalueone',
+ 'twonameTwo': 'twovaluetwo'},
+ 'thrEE': {'threeNAMEone': 'threevalueone',
+ 'thrEEnametwo': 'threevaluetwo'},
+ 'foUr': {'fournameone': 'fourvalueone',
+ 'fournametwo': 'fourvaluetwo'},
+ 'FIVE': ['one', 'two', 'three'],
+ 'six': ['ONE', 'two', 'three']}
+
+ tci_mappings = [[['onenameone'], 'onemappedone'],
+ [['onenametwo'], 'onemappedtwo'],
+ [['two', '*'], '*'],
+ [['three', 'threenameone'], 'threemappedone'],
+ [['three', 'threenameone'], 'threemappedbis'],
+ [['four', '*'], ['Four', '*']],
+ [['five'], 'listfive'],
+ [['six', 'one'], ['six', 'mapone']]]
+
+ mci_result = {'onemappedone': 'onevalueone',
+ 'onemappedtwo': 'onevaluetwo',
+ 'twonameone': 'twovalueone',
+ 'twonameTwo': 'twovaluetwo',
+ 'threemappedone': 'threevalueone',
+ 'threemappedbis': 'threevalueone',
+ 'Four': {'fournameone': 'fourvalueone',
+ 'fournametwo': 'fourvaluetwo'},
+ 'listfive': ['one', 'two', 'three'],
+ 'six': ['mapone']}
+
+ nci_result = {'thrEE': {'thrEEnametwo': 'threevaluetwo'},
+ 'six': ['two', 'three']}
+
+ p = Policy(tci_mappings)
+ print 'Case insensitive attribute mapping'
+ m, n = p.map_attributes(tci_attributes, ignore_case=True)
+ if m == mci_result and n == nci_result:
+ print 'SUCCESS'
+ else:
+ ret += 1
+ print 'FAIL: Expected %s // %s\nObtained %s // %s' % \
+ (mci_result, nci_result, m, n)
+