Rev 5751: Damn, the sections can't be pre-loaded or need to be reloaded on modifications or even better lazily iterated instead. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Apr 5 16:10:52 UTC 2011


At file:///home/vila/src/bzr/experimental/config/

------------------------------------------------------------
revno: 5751
revision-id: v.ladeuil+lp at free.fr-20110405161052-1swij0q6zfb9un26
parent: v.ladeuil+lp at free.fr-20110405152646-6ddal7js46vebqx7
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-stack
timestamp: Tue 2011-04-05 18:10:52 +0200
message:
  Damn, the sections can't be pre-loaded or need to be reloaded on modifications or even better lazily iterated instead.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-04-05 15:26:46 +0000
+++ b/bzrlib/tests/test_config.py	2011-04-05 16:10:52 +0000
@@ -2063,6 +2063,15 @@
         # Did we get it back ?
         self.assertEquals('baz', conf.get('foo'))
 
+    def test_set_creates_a_new_section(self):
+        store = config.ConfigObjStore.from_string(
+            '', self.get_transport(), 'test.conf')
+        conf = config.ConfigStack(list(store.get_sections()), store)
+        conf.set('foo', 'baz')
+        self.expectFailure(
+            'Newly created sections were not known at stack build time',
+            self.assertEquals, 'baz', conf.get('foo'))
+
 
 class TestConfigGetOptions(tests.TestCaseWithTransport, TestOptionsMixin):
 



More information about the bazaar-commits mailing list