~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

Add a test for appendpath support in no-name section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2185
2185
        self.assertEquals(['baz', 'bar/baz'],
2186
2186
                          [section.extra_path for section in sections])
2187
2187
 
 
2188
    def test_appendpath_in_no_name_section(self):
 
2189
        # It's a bit weird to allow appendpath in a no-name section, but
 
2190
        # someone may found a use for it
 
2191
        store = self.get_store('foo.conf')
 
2192
        store._load_from_string('''
 
2193
foo=bar
 
2194
foo:policy = appendpath
 
2195
''')
 
2196
        matcher = config.LocationMatcher(store, 'dir/subdir')
 
2197
        sections = list(matcher.get_sections())
 
2198
        self.assertLength(1, sections)
 
2199
        self.assertEquals('bar/dir/subdir', sections[0].get('foo'))
 
2200
 
2188
2201
 
2189
2202
class TestStackGet(tests.TestCase):
2190
2203