summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2014-10-14 09:40:24 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2014-11-10 17:35:43 -0600
commit5ceb76e562dc5aedae08910f65c2ff7cdf0c9ac1 (patch)
tree9a7b61d9d341ca8759c59c43b24063904bf05e48 /testsuite
parent477c9c4119df5fd45c1129651922d238dccad8c9 (diff)
downloadbcfg2-5ceb76e562dc5aedae08910f65c2ff7cdf0c9ac1.tar.gz
bcfg2-5ceb76e562dc5aedae08910f65c2ff7cdf0c9ac1.tar.bz2
bcfg2-5ceb76e562dc5aedae08910f65c2ff7cdf0c9ac1.zip
testsuite: skip nested exclusive option group test on py2.6
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testsrc/Testlib/TestOptions/TestOptionGroups.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/testsuite/Testsrc/Testlib/TestOptions/TestOptionGroups.py b/testsuite/Testsrc/Testlib/TestOptions/TestOptionGroups.py
index de1abbb1b..7611d6202 100644
--- a/testsuite/Testsrc/Testlib/TestOptions/TestOptionGroups.py
+++ b/testsuite/Testsrc/Testlib/TestOptions/TestOptionGroups.py
@@ -1,11 +1,12 @@
"""test reading multiple config files."""
import argparse
+import sys
from Bcfg2.Options import Option, BooleanOption, Parser, OptionGroup, \
ExclusiveOptionGroup, WildcardSectionGroup, new_parser, get_parser
-from testsuite.common import Bcfg2TestCase
+from testsuite.common import Bcfg2TestCase, skipUnless
from testsuite.Testsrc.Testlib.TestOptions import make_config, OptionTestCase
@@ -59,8 +60,10 @@ class TestOptionGroups(Bcfg2TestCase):
self.assertRaises(SystemExit, self._test_options, [])
- def test_option_group(self):
- """nest option groups."""
+
+class TestNestedOptionGroups(TestOptionGroups):
+ def setUp(self):
+ TestOptionGroups.setUp(self)
self.options = [
OptionGroup(
BooleanOption("--foo"),
@@ -73,6 +76,9 @@ class TestOptionGroups(Bcfg2TestCase):
BooleanOption("--test2")),
title="inner"),
title="outer")]
+
+ def test_option_group(self):
+ """nest option groups."""
result = self._test_options(["--foo", "--baz", "--test1"])
self.assertTrue(result.foo)
self.assertFalse(result.bar)
@@ -81,6 +87,10 @@ class TestOptionGroups(Bcfg2TestCase):
self.assertTrue(result.test1)
self.assertFalse(result.test2)
+ @skipUnless(sys.version_info >= (2, 7),
+ "Nested exclusive option groups do not work in Python 2.6")
+ def test_nested_exclusive_option_groups(self):
+ """nest exclusive option groups."""
self.assertRaises(SystemExit,
self._test_options, ["--test1", "--test2"])