diff --git a/etg/config.py b/etg/config.py index d343c209..7806c3a1 100644 --- a/etg/config.py +++ b/etg/config.py @@ -162,12 +162,19 @@ def run(): #----------------------------------------------------------------- c = module.find('wxFileConfig') c.addPrivateCopyCtor() - c.find('wxFileConfig').findOverload('wxInputStream').ignore() - ctor = c.find('wxFileConfig').findOverload('wxString') - ctor.items.remove(ctor.find('conv')) - ctor = c.find('Save').ignore() + c.find('wxFileConfig').findOverload('wxInputStream').find('conv').ignore() + ctor = c.find('wxFileConfig').findOverload('wxString').find('conv').ignore() + #ctor.items.remove(ctor.find('conv')) + ctor = c.find('Save').find('conv').ignore() c.find('GetGlobalFile').ignore() c.find('GetLocalFile').ignore() + + c.find('GetFirstGroup').ignore() + c.find('GetNextGroup').ignore() + c.find('GetFirstEntry').ignore() + c.find('GetNextEntry').ignore() + + #----------------------------------------------------------------- # In C++ wxConfig is a #define to some other config class. We'll let our diff --git a/unittests/test_config.py b/unittests/test_config.py index 69e8b6db..c0dc0b57 100644 --- a/unittests/test_config.py +++ b/unittests/test_config.py @@ -65,7 +65,7 @@ class ConfigTests(wtc.WidgetTestCase): os.remove(name) - def _test_Config4(self): # disabled for now... + def test_Config4(self): # disabled for now... null = wx.LogNull() name = cfgFilename + '_4' @@ -139,6 +139,54 @@ class ConfigTests(wtc.WidgetTestCase): del cfg if os.path.exists(name): os.remove(name) + + + def test_Config6(self): + null = wx.LogNull() + name = cfgFilename + '_6' + + cfg = wx.FileConfig('unittest_ConfigTests', localFilename=name) + cfg.SetPath('/zero') + cfg.Write('key1', 'value') + cfg.Write('key2', 'value') + cfg.Write('key3', 'value') + + cfg.SetPath('/one') + cfg.Write('key1', 'value') + cfg.Write('key2', 'value') + cfg.Write('key3', 'value') + + cfg.SetPath('/two') + cfg.Write('key1', 'value') + cfg.Write('key2', 'value') + cfg.Write('key3', 'value') + + cfg.SetPath('/three') + cfg.Write('key1', 'value') + cfg.Write('key2', 'value') + cfg.Write('key3', 'value') + + cfg.Flush() + + cfg.SetPath('/') + count = 0 + more, group, index = cfg.GetFirstGroup() + while more: + count += 1 + more, group, index = cfg.GetNextGroup(index) + self.assertEqual(count, 4) + + cfg.SetPath('/two') + count = 0 + more, entry, index = cfg.GetFirstEntry() + while more: + count += 1 + more, entry, index = cfg.GetNextEntry(index) + self.assertEqual(count, 3) + + del cfg + if os.path.exists(name): + os.remove(name) #---------------------------------------------------------------------------