From 64bb16f5f70c6cc97cede6782e45583af9bdced3 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Sat, 8 Mar 2008 18:42:00 +0000 Subject: implement support for long options git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4404 ce84e21b-d406-0410-9b95-82705330c041 --- testsuite/TestOptions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'testsuite/TestOptions.py') diff --git a/testsuite/TestOptions.py b/testsuite/TestOptions.py index bf49c4326..8e2f9b91d 100644 --- a/testsuite/TestOptions.py +++ b/testsuite/TestOptions.py @@ -49,6 +49,16 @@ class TestOptionSet(object): res = os.buildGetopt() assert 'H:' in res and 'G' in res and len(res) == 3 + def test_buildLongGetopt(self): + opts = [('foo', Bcfg2.Options.Option('foo', 'test1', cmd='-G')), + ('bar', Bcfg2.Options.Option('foo', 'test2')), + ('baz', Bcfg2.Options.Option('foo', 'test1', cmd='--H', + odesc='1', long_arg=True))] + os = Bcfg2.Options.OptionSet(opts) + res = os.buildLongGetopt() + print res + assert 'H=' in res and len(res) == 1 + def test_parse(self): opts = [('foo', Bcfg2.Options.Option('foo', 'test1', cmd='-G')), ('bar', Bcfg2.Options.Option('foo', 'test2')), -- cgit v1.2.3-1-g7c22