~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_debug.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-09 22:14:24 UTC
  • mfrom: (5777.4.2 mutableinventorytree)
  • mto: This revision was merged to the branch mainline in revision 5787.
  • Revision ID: jelmer@samba.org-20110409221424-a2air35exbz50hi8
Mergemutableinventorytree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    def test_set_debug_flags_from_config(self):
30
30
        # test both combinations because configobject automatically splits up
31
31
        # comma-separated lists
32
 
        self.assertDebugFlags(['hpss', 'error'], 'debug_flags = hpss, error\n')
33
 
        self.assertDebugFlags(['hpss'], 'debug_flags = hpss\n')
 
32
        self.try_debug_flags(['hpss', 'error'], 'debug_flags = hpss, error\n')
 
33
        self.try_debug_flags(['hpss'], 'debug_flags = hpss\n')
34
34
 
35
 
    def assertDebugFlags(self, expected_flags, conf_bytes):
36
 
        conf = config.GlobalStack()
37
 
        conf.store._load_from_string(conf_bytes)
38
 
        conf.store.save()
 
35
    def try_debug_flags(self, expected_flags, conf_bytes):
 
36
        conf = config.GlobalConfig.from_string(conf_bytes, save=True)
39
37
        self.overrideAttr(debug, 'debug_flags', set())
40
38
        debug.set_debug_flags_from_config()
41
39
        self.assertEqual(set(expected_flags), debug.debug_flags)