~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Martin
  • Date: 2010-05-16 15:18:43 UTC
  • mfrom: (5235 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5239.
  • Revision ID: gzlist@googlemail.com-20100516151843-lu53u7caehm3ie3i
Merge bzr.dev to resolve conflicts in NEWS and _chk_map_pyx

Show diffs side-by-side

added added

removed removed

Lines of Context:
406
406
        get_bool = conf.get_user_option_as_bool
407
407
        self.assertEqual(True, get_bool('a_true_bool'))
408
408
        self.assertEqual(False, get_bool('a_false_bool'))
 
409
        warnings = []
 
410
        def warning(*args):
 
411
            warnings.append(args[0] % args[1:])
 
412
        self.overrideAttr(trace, 'warning', warning)
 
413
        msg = 'Value "%s" is not a boolean for "%s"'
409
414
        self.assertIs(None, get_bool('an_invalid_bool'))
 
415
        self.assertEquals(msg % ('maybe', 'an_invalid_bool'), warnings[0])
 
416
        warnings = []
410
417
        self.assertIs(None, get_bool('not_defined_in_this_config'))
411
 
 
 
418
        self.assertEquals([], warnings)
412
419
 
413
420
    def test_get_user_option_as_list(self):
414
421
        conf, parser = self.make_config_parser("""