summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-11-12 16:25:57 -0500
committerMark McLoughlin <markmc@redhat.com>2012-11-15 15:01:11 -0500
commit768a147ac5e993df3eda3558542a3fe81b8a3d11 (patch)
tree27b136dd15764e71f215a05f9e650fd80229ce83 /tests
parentac180b95d1867c4b4daf9729e97ce93f3201d178 (diff)
downloadoslo-768a147ac5e993df3eda3558542a3fe81b8a3d11.tar.gz
oslo-768a147ac5e993df3eda3558542a3fe81b8a3d11.tar.xz
oslo-768a147ac5e993df3eda3558542a3fe81b8a3d11.zip
Use stock argparse --usage behaviour
optparse would substitute the program name for %prog, but argparse requires %(prog)s. Also, optparse would print 'Usage:' whereas argparse prints 'usage:'. Neither optparse behaviour that's worth retaining, let's just use the default argparse behaviour. Change-Id: Ied2acb37c366f1a45aed72b6b76f11e2de23828e
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_cfg.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py
index d4559d0..84ab73e 100644
--- a/tests/unit/test_cfg.py
+++ b/tests/unit/test_cfg.py
@@ -81,7 +81,7 @@ class BaseTestCase(unittest.TestCase):
args=args,
prog='test',
version='1.0',
- usage='%prog FOO BAR',
+ usage='%(prog)s FOO BAR',
default_config_files=[])
def setUp(self):
@@ -122,7 +122,7 @@ class UsageTestCase(BaseTestCase):
f = StringIO.StringIO()
self.conf([])
self.conf.print_usage(file=f)
- self.assertTrue('Usage: test FOO BAR' in f.getvalue())
+ self.assertTrue('usage: test FOO BAR' in f.getvalue())
self.assertTrue('Options:' not in f.getvalue())
@@ -132,7 +132,7 @@ class HelpTestCase(BaseTestCase):
f = StringIO.StringIO()
self.conf([])
self.conf.print_help(file=f)
- self.assertTrue('Usage: test FOO BAR' in f.getvalue())
+ self.assertTrue('usage: test FOO BAR' in f.getvalue())
self.assertTrue('Options:' in f.getvalue())
self.assertTrue('-h, --help' in f.getvalue())