diff options
| author | Giampaolo Lauria <lauria@us.ibm.com> | 2012-07-20 16:41:45 -0400 |
|---|---|---|
| committer | Giampaolo Lauria <lauria@us.ibm.com> | 2012-07-24 11:12:05 -0400 |
| commit | 90da88cce51bccd320e89141ed7384d2e7ccca9d (patch) | |
| tree | 9b7636cc854e3705c88e9d2fb2a16c5e2326ada4 /tests | |
| parent | 1e2298fadb38280b46c811e1feb43f4e9244de77 (diff) | |
| download | oslo-90da88cce51bccd320e89141ed7384d2e7ccca9d.tar.gz oslo-90da88cce51bccd320e89141ed7384d2e7ccca9d.tar.xz oslo-90da88cce51bccd320e89141ed7384d2e7ccca9d.zip | |
Modifies _is_opt_registered fcn to check for duplicate opts
This change fixes bug 999307
Currently, the check for duplicate options is done by checking
whether they are the same object. The proposed fix is to check whether
all the object fields have the same value.
Change-Id: I2b72d630a0c8821df1d81e25d316d8d9195be492
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_cfg.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py index c72c18e..d6286d3 100644 --- a/tests/unit/test_cfg.py +++ b/tests/unit/test_cfg.py @@ -1220,18 +1220,14 @@ class SadPathTestCase(BaseTestCase): def test_ok_duplicate(self): opt = StrOpt('foo') self.conf.register_cli_opt(opt) - self.conf.register_cli_opt(opt) + opt2 = StrOpt('foo') + self.conf.register_cli_opt(opt2) self.conf([]) self.assertTrue(hasattr(self.conf, 'foo')) self.assertEquals(self.conf.foo, None) - def test_error_duplicate(self): - self.conf.register_cli_opt(StrOpt('foo')) - 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')) |
