예제 #1
0
 def __init__(self, session, config, parent):
     self.indexes = CaselessDictionary()
     self.protocolMaps = CaselessDictionary()
     self.indexConfigs = CaselessDictionary()
     self.protocolMapConfigs = CaselessDictionary()
     self.records = {}
     Database.__init__(self, session, config, parent)
     SummaryObject.__init__(self, session, config, parent)
     if not session.database:
         session.database = self.id
예제 #2
0
 def test_setitem(self):
     # Test that items can be got after being set
     cd = CaselessDictionary()
     for key, val in self.d.iteritems():
         cd[key] = val
         self.assertEqual(cd[key], val)
         self.assertEqual(cd[key.lower()], val)
예제 #3
0
 def setUp(self):
     # Set up a regular dictionary for quick init of caseless one in tests
     l = [(char, i) for i, char in enumerate(string.uppercase)]
     self.d = d = dict(l)
     # Set up a caseless dictionary for non-mutating tests
     self.cd = CaselessDictionary(d)
예제 #4
0
 def test_init(self):
     self.assertIsInstance(CaselessDictionary(), CaselessDictionary)
     self.assertIsInstance(CaselessDictionary(self.d), CaselessDictionary)
     self.assertIsInstance(CaselessDictionary(self.d.items()),
                           CaselessDictionary)