예제 #1
0
 def setUp(self):
     self.backup = []
     # paranoid check
     self.cfgstr = str(cfg)
     # clean up externals cfg for proper testing
     if cfg.has_section('externals'):
         self.backup = copy.deepcopy(cfg.items('externals'))
     cfg.remove_section('externals')
예제 #2
0
 def setUp(self):
     self.backup = []
     # paranoid check
     self.cfgstr = str(cfg)
     # clean up externals cfg for proper testing
     if cfg.has_section('externals'):
         self.backup = copy.deepcopy(cfg.items('externals'))
     cfg.remove_section('externals')
예제 #3
0
 def tearDown(self):
     if len(self.backup):
         # wipe existing one completely
         if cfg.has_section('externals'):
             cfg.remove_section('externals')
         cfg.add_section('externals')
         for o,v in self.backup:
             cfg.set('externals', o,v)
     # paranoid check
     # since order can't be guaranteed, lets check
     # each item after sorting
     self.assertEqual(sorted(self.cfgstr.split('\n')),
                          sorted(str(cfg).split('\n')))
예제 #4
0
 def tearDown(self):
     if len(self.backup):
         # wipe existing one completely
         if cfg.has_section('externals'):
             cfg.remove_section('externals')
         cfg.add_section('externals')
         for o, v in self.backup:
             cfg.set('externals', o, v)
     # paranoid check
     # since order can't be guaranteed, lets check
     # each item after sorting
     self.assertEqual(sorted(self.cfgstr.split('\n')),
                      sorted(str(cfg).split('\n')))