~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Vincent Ladeuil
  • Date: 2011-05-15 16:07:11 UTC
  • mto: (5743.13.4 config-editor-option)
  • mto: This revision was merged to the branch mainline in revision 5944.
  • Revision ID: v.ladeuil+lp@free.fr-20110515160711-l0og3ady9wuahz1k
Stack.get() provides the registered option default value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2385
2385
        conf_stack = config.Stack([conf])
2386
2386
        self.assertEquals('bar', conf_stack.get('foo'))
2387
2387
 
 
2388
    def test_get_with_default_value(self):
 
2389
        conf_stack = config.Stack([dict()])
 
2390
        opt = config.Option('foo', default='bar')
 
2391
        self.overrideAttr(config, 'option_registry', registry.Registry())
 
2392
        config.option_registry.register('foo', opt)
 
2393
        self.assertEquals('bar', conf_stack.get('foo'))
 
2394
 
2388
2395
    def test_get_first_definition(self):
2389
2396
        conf1 = dict(foo='bar')
2390
2397
        conf2 = dict(foo='baz')