Esempio n. 1
0
 def testPropertyToDict(self):
     '''
     Test that we can go from attr to index
     '''
     handle = AttributeDict()
     handle.name1 = 1
     handle.name2 += 1
     self.assertEqual(handle['name1'], 1)
     self.assertEqual(handle['name1'], 1)
     del handle.name1
     del handle.name2
     self.assertEqual(handle.keys(), [])
Esempio n. 2
0
 def testDictToProperty(self):
     '''
     Test that we can go from index to attr
     '''
     handle = AttributeDict()
     handle['name1'] = 1
     handle['name2'] += 1
     self.assertEqual(handle.name1, 1)
     self.assertEqual(handle.name2, 1)
     del handle['name1']
     del handle['name2']
     self.assertEqual(handle.keys(), [])