Rev 5778: Address some review comments from jelmer and poolie. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue May 3 10:36:30 UTC 2011


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

------------------------------------------------------------
revno: 5778
revision-id: v.ladeuil+lp at free.fr-20110503103630-1jp0uxb5tjd7yjsg
parent: v.ladeuil+lp at free.fr-20110503095837-1oa5f61t9xol8ewh
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-stack
timestamp: Tue 2011-05-03 12:36:30 +0200
message:
  Address some review comments from jelmer and poolie.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-05-03 09:58:37 +0000
+++ b/bzrlib/tests/test_config.py	2011-05-03 10:36:30 +0000
@@ -2179,9 +2179,9 @@
 
 
 
-class TestConfigStackGet(tests.TestCase):
+class TestStackGet(tests.TestCase):
 
-    # FIXME: This should be parametrized for all known ConfigStack or dedicated
+    # FIXME: This should be parametrized for all known Stack or dedicated
     # paramerized tests created to avoid bloating -- vila 2011-03-31
 
     def test_single_config_get(self):
@@ -2209,10 +2209,15 @@
         conf_stack = config.Stack([lambda : []])
         self.assertEquals(None, conf_stack.get('foo'))
 
-
-class TestConfigStackSet(tests.TestCaseWithTransport):
-
-    # FIXME: This should be parametrized for all known ConfigStack or dedicated
+    def test_get_for_broken_callable(self):
+        # Trying to use and invalid callable raises an exception on first use
+        conf_stack = config.Stack([lambda : object()])
+        self.assertRaises(TypeError, conf_stack.get, 'foo')
+
+
+class TestStackSet(tests.TestCaseWithTransport):
+
+    # FIXME: This should be parametrized for all known Stack or dedicated
     # paramerized tests created to avoid bloating -- vila 2011-04-05
 
     def test_simple_set(self):
@@ -2231,9 +2236,9 @@
         self.assertEquals, 'baz', conf.get('foo')
 
 
-class TestConfigStackRemove(tests.TestCaseWithTransport):
+class TestStackRemove(tests.TestCaseWithTransport):
 
-    # FIXME: This should be parametrized for all known ConfigStack or dedicated
+    # FIXME: This should be parametrized for all known Stack or dedicated
     # paramerized tests created to avoid bloating -- vila 2011-04-06
 
     def test_remove_existing(self):

=== modified file 'doc/developers/configuration.txt'
--- a/doc/developers/configuration.txt	2011-05-03 09:23:56 +0000
+++ b/doc/developers/configuration.txt	2011-05-03 10:36:30 +0000
@@ -88,9 +88,10 @@
 option but these sections shouldn't be modified lightly as modifying an option
 used for different contexts will indeed be seen by all these contexts.
 
-Default values in configuration files are defined by users, developers
+Default values in configuration files are defined by users. Developers
 shouldn't have to modify them, as such, no mechanism nor heuristics are used
-to find which section (or sections) should be modified, a ``Stack`` defines a
-mutable section when there is no ambiguity, if there is one, then the *user*
-should be able to decide and this case a new ``Stack`` can be created cheaply.
+to find which section (or sections) should be modified.
 
+A ``Stack`` defines a mutable section when there is no ambiguity.  If there
+is one, then the *user* should be able to decide and in this case a new
+``Stack`` can be created cheaply.



More information about the bazaar-commits mailing list