aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/18_test_Config.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-04-02 22:13:46 +0200
committerGuido Günther <agx@sigxcpu.org>2014-04-03 20:34:07 +0200
commit459d9bfcce481b0da71e9493e644488c83e0e9ba (patch)
tree4fa6b653354cba87f5da0953b151d54af474a5bb /tests/18_test_Config.py
parentb393080ac3b98342b53849d14049db024183f0cb (diff)
config: add decorator to add_option_* functions
This allows us to build an internal list of valid options and print these.
Diffstat (limited to 'tests/18_test_Config.py')
-rw-r--r--tests/18_test_Config.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/18_test_Config.py b/tests/18_test_Config.py
index ae39b5a2..f7ba8c9c 100644
--- a/tests/18_test_Config.py
+++ b/tests/18_test_Config.py
@@ -2,7 +2,7 @@
import os
import unittest
-from gbp.config import GbpOptionParser
+from gbp.config import GbpOptionParser, GbpOptionGroup
from . import context
class TestConfigParser(unittest.TestCase):
@@ -71,3 +71,17 @@ class TestConfigParser(unittest.TestCase):
self.assertEqual(parser.get_config_file_value('new_overrides_git_option1'),
'new_overrides_git_value1')
self.assertEqual(parser.get_config_file_value('doesnotexist'), None)
+
+ def test_param_list(self):
+ parser = GbpOptionParser('cmd4')
+
+ branch_group = GbpOptionGroup(parser, "branch options", "branch update and layout options")
+ parser.add_option_group(branch_group)
+ branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
+ branch_group.add_config_file_option("debian-branch", dest="upstream_branch")
+ parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+
+ params = parser.valid_options
+ self.assertTrue('upstream-branch' in params)
+ self.assertTrue('debian-branch' in params)
+ self.assertTrue('color' in params)