~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-02-04 17:14:58 UTC
  • mto: This revision was merged to the branch mainline in revision 5684.
  • Revision ID: v.ladeuil+lp@free.fr-20110204171458-dwmwixlsbg1cjoad
One more test for using the additional env.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
        c = self.get_config('')
356
356
        self.assertInterpolate('foo', c, 'foo')
357
357
 
358
 
    def test_in_env(self):
 
358
    def test_env_adding_options(self):
359
359
        c = self.get_config('')
360
360
        self.assertInterpolate('bar', c, '{foo}', {'foo': 'bar'})
361
361
 
 
362
    def test_env_overriding_options(self):
 
363
        c = self.get_config('foo=baz')
 
364
        self.assertInterpolate('bar', c, '{foo}', {'foo': 'bar'})
 
365
 
362
366
    def test_simple_ref(self):
363
367
        c = self.get_config('foo=xxx')
364
368
        self.assertInterpolate('xxx', c, '{foo}')
365
369
 
366
370
    def test_indirect_ref(self):
367
 
        c = self.get_config("""foo=xxx
 
371
        c = self.get_config('''
 
372
foo=xxx
368
373
bar={foo}
369
 
""")
 
374
''')
370
375
        self.assertInterpolate('xxx', c, '{bar}')
371
376
 
372
377
    def test_embedded_ref(self):
373
 
        c = self.get_config("""foo=xxx
 
378
        c = self.get_config('''
 
379
foo=xxx
374
380
bar=foo
375
 
""")
 
381
''')
376
382
        self.assertInterpolate('xxx', c, '{{bar}}')
377
383
 
378
384
    def test_simple_loop(self):
380
386
        self.assertRaises(errors.InterpolationLoop, c.interpolate, '{foo}')
381
387
 
382
388
    def test_indirect_loop(self):
383
 
        c = self.get_config('foo={bar}\nbar={baz}\nbaz={foo}')
 
389
        c = self.get_config('''
 
390
foo={bar}
 
391
bar={baz}
 
392
baz={foo}''')
384
393
        e = self.assertRaises(errors.InterpolationLoop,
385
394
                              c.interpolate, '{foo}')
386
395
        self.assertEquals('foo->bar->baz', e.refs)