summaryrefslogtreecommitdiffstats
path: root/testsuite/TestOptions.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-03-31 22:54:31 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-03-31 22:54:31 +0000
commitbde65a6f19974d60eb49e2108065795da6778c9b (patch)
tree9d33b1578f9d1208579559e9a426a2195bb0957f /testsuite/TestOptions.py
parentf8d2d903dfe633671486b8e87635bd3f821b5263 (diff)
downloadbcfg2-bde65a6f19974d60eb49e2108065795da6778c9b.tar.gz
bcfg2-bde65a6f19974d60eb49e2108065795da6778c9b.tar.bz2
bcfg2-bde65a6f19974d60eb49e2108065795da6778c9b.zip
Fix Options (don't cook default values) (needed for the multi-fingerprint patch)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4463 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'testsuite/TestOptions.py')
-rw-r--r--testsuite/TestOptions.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/testsuite/TestOptions.py b/testsuite/TestOptions.py
index 8e2f9b91d..e7d2aeff0 100644
--- a/testsuite/TestOptions.py
+++ b/testsuite/TestOptions.py
@@ -16,29 +16,30 @@ class TestOption(object):
o.parse([], ['-F', 'test'])
assert o.value == 'test'
o.parse([('-F', 'test2')], [])
- assert o._value == 'test2'
+ assert o.value == 'test2'
os.environ['TEST2'] = 'test3'
o.parse([], [])
- assert o._value == 'test3'
+ assert o.value == 'test3'
del os.environ['TEST2']
o.parse([], [])
- print o._value
- assert o._value == 'foobat'
+ print o.value
+ assert o.value == 'foobat'
o.cf = ('communication', 'pwd')
o.parse([], [])
- print o._value
- assert o._value == 'test4'
+ print o.value
+ assert o.value == 'test4'
o.cf = False
o.parse([], [])
- assert o._value == 'test4'
+ assert o.value == 'test4'
def test_cook(self):
+ # check that default value isn't cooked
o1 = Bcfg2.Options.Option('foo', 'test4', cook=Bcfg2.Options.bool_cook)
o1.parse([], [])
- assert o1.value == True
- o2 = Bcfg2.Options.Option('foo', '', cook=Bcfg2.Options.bool_cook)
- o2.parse([], [])
- assert o2.value == False
+ assert o1.value == 'test4'
+ o2 = Bcfg2.Options.Option('foo', False, cmd='-F')
+ o2.parse([('-F', '')], [])
+ assert o2.value == True
class TestOptionSet(object):
def test_buildGetopt(self):