summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_cfg.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-29 14:49:43 +0000
committerGerrit Code Review <review@openstack.org>2012-11-29 14:49:43 +0000
commitf888f83116ac7cfcf26aa4ed2243c15fbec882c6 (patch)
tree74c9a77c5f7cd27a91b711b5cc9af22e0aaaf505 /tests/unit/test_cfg.py
parent2c705107f69fa9e3e845ab9f9910a78c8bb77821 (diff)
parent4b636dc65adce613f394c4ba5c0724c2f9fedc9f (diff)
downloadoslo-f888f83116ac7cfcf26aa4ed2243c15fbec882c6.tar.gz
oslo-f888f83116ac7cfcf26aa4ed2243c15fbec882c6.tar.xz
oslo-f888f83116ac7cfcf26aa4ed2243c15fbec882c6.zip
Merge "Add another duplicate opt test case"
Diffstat (limited to 'tests/unit/test_cfg.py')
-rw-r--r--tests/unit/test_cfg.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py
index a9fdc13..644edca 100644
--- a/tests/unit/test_cfg.py
+++ b/tests/unit/test_cfg.py
@@ -1335,6 +1335,11 @@ class SadPathTestCase(BaseTestCase):
self.assertTrue(hasattr(self.conf, 'foo'))
self.assertEquals(self.conf.foo, None)
+ def test_error_duplicate(self):
+ self.conf.register_cli_opt(StrOpt('foo', help='bar'))
+ self.assertRaises(DuplicateOptError,
+ self.conf.register_cli_opt, StrOpt('foo'))
+
def test_error_duplicate_with_different_dest(self):
self.conf.register_cli_opt(StrOpt('foo', dest='f'))
self.conf.register_cli_opt(StrOpt('foo'))