summaryrefslogtreecommitdiff
path: root/cliapp/settings_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-07-18 19:20:15 +0100
committerLars Wirzenius <liw@liw.fi>2011-07-18 19:20:15 +0100
commite5274002f6d67d1a9d689fbec638b59c913e559f (patch)
treee7ad6c6fd88f4ea235e683d994e7bd70c4747f44 /cliapp/settings_tests.py
parentb8ee6b8affcd0503dde6bf8946fe60ab63e6b7e7 (diff)
downloadcliapp-e5274002f6d67d1a9d689fbec638b59c913e559f.tar.gz
Allow usage to be a func, for deferred evaluation.
Diffstat (limited to 'cliapp/settings_tests.py')
-rw-r--r--cliapp/settings_tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cliapp/settings_tests.py b/cliapp/settings_tests.py
index 776eded..fcb6764 100644
--- a/cliapp/settings_tests.py
+++ b/cliapp/settings_tests.py
@@ -37,6 +37,11 @@ class SettingsTests(unittest.TestCase):
def test_has_version(self):
self.assertEqual(self.settings.version, '1.0')
+ def test_sets_usage_from_func(self):
+ s = cliapp.Settings('appname', '1.0', usage=lambda: 'xyzzy')
+ p = s.build_parser()
+ self.assert_('xyzzy' in p.usage)
+
def test_adds_default_options_and_settings(self):
self.assert_('output' in self.settings)
self.assert_('log' in self.settings)