Rev 6067: Add more tests to be really sure we get lists. in file:///home/vila/src/bzr/experimental/list-option/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Aug 12 07:23:01 UTC 2011


At file:///home/vila/src/bzr/experimental/list-option/

------------------------------------------------------------
revno: 6067
revision-id: v.ladeuil+lp at free.fr-20110812072301-wxjabpfoamxg6u51
parent: v.ladeuil+lp at free.fr-20110810143017-v6hjf9xnmqj9x6dp
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: list-option
timestamp: Fri 2011-08-12 09:23:01 +0200
message:
  Add more tests to be really sure we get lists.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-08-10 14:30:17 +0000
+++ b/bzrlib/tests/test_config.py	2011-08-12 07:23:01 +0000
@@ -3045,12 +3045,24 @@
         self.conf.store._load_from_string('foo=,')
         self.assertEquals([], self.conf.get('foo'))
 
-    def test_get_with_list_converter_one_item(self):
+    def test_get_with_list_converter_one_boolean(self):
+        self.register_list_option('foo', [1])
+        self.conf.store._load_from_string('foo=True')
+        # We get a list of one string
+        self.assertEquals(['True'], self.conf.get('foo'))
+
+    def test_get_with_list_converter_one_integer(self):
         self.register_list_option('foo', [1])
         self.conf.store._load_from_string('foo=2')
-        # We get a list of strings
+        # We get a list of one string
         self.assertEquals(['2'], self.conf.get('foo'))
 
+    def test_get_with_list_converter_one_string(self):
+        self.register_list_option('foo', ['foo'])
+        self.conf.store._load_from_string('foo=bar')
+        # We get a list of one string
+        self.assertEquals(['bar'], self.conf.get('foo'))
+
     def test_get_with_list_converter_many_items(self):
         self.register_list_option('foo', [1])
         self.conf.store._load_from_string('foo=m,o,r,e')



More information about the bazaar-commits mailing list