~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_debug.py

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
class TestDebugFlags(tests.TestCaseInTempDir):
28
28
 
29
 
    def test_set_debug_flags_from_config(self):
30
 
        # test both combinations because configobject automatically splits up
31
 
        # comma-separated lists
 
29
    def test_set_no_debug_flags_from_config(self):
 
30
        self.assertDebugFlags([], '')
 
31
 
 
32
    def test_set_single_debug_flags_from_config(self):
 
33
        self.assertDebugFlags(['hpss'], 'debug_flags = hpss\n')
 
34
 
 
35
    def test_set_multiple_debug_flags_from_config(self):
32
36
        self.assertDebugFlags(['hpss', 'error'], 'debug_flags = hpss, error\n')
33
 
        self.assertDebugFlags(['hpss'], 'debug_flags = hpss\n')
34
37
 
35
38
    def assertDebugFlags(self, expected_flags, conf_bytes):
36
39
        conf = config.GlobalStack()
37
 
        conf.store._load_from_string(conf_bytes)
 
40
        conf.store._load_from_string('[DEFAULT]\n' + conf_bytes)
38
41
        conf.store.save()
39
42
        self.overrideAttr(debug, 'debug_flags', set())
40
43
        debug.set_debug_flags_from_config()