~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

Start implementing a config stack.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1817
1817
        self.assertIs(None, bzrdir_config.get_default_stack_on())
1818
1818
 
1819
1819
 
 
1820
class TestConfigStackGet(tests.TestCase):
 
1821
 
 
1822
    def test_compatibility(self):
 
1823
        self.assertRaises(AssertionError, config.ConfigStack, [object()])
 
1824
 
 
1825
    def test_single_config_get(self):
 
1826
        conf = dict(foo='bar')
 
1827
        conf_stack = config.ConfigStack([conf])
 
1828
        self.assertEquals('bar', conf_stack.get('foo'))
 
1829
 
 
1830
    def test_get_first_definition(self):
 
1831
        conf1 = dict(foo='bar')
 
1832
        conf2 = dict(foo='baz')
 
1833
        conf_stack = config.ConfigStack([conf1, conf2])
 
1834
        self.assertEquals('bar', conf_stack.get('foo'))
 
1835
 
 
1836
 
1820
1837
class TestConfigGetOptions(tests.TestCaseWithTransport, TestOptionsMixin):
1821
1838
 
1822
1839
    def setUp(self):