~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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"'
414
409
        self.assertIs(None, get_bool('an_invalid_bool'))
415
 
        self.assertEquals(msg % ('maybe', 'an_invalid_bool'), warnings[0])
416
 
        warnings = []
417
410
        self.assertIs(None, get_bool('not_defined_in_this_config'))
418
 
        self.assertEquals([], warnings)
 
411
 
419
412
 
420
413
    def test_get_user_option_as_list(self):
421
414
        conf, parser = self.make_config_parser("""