Rev 2602: Fix up tests for option help cleanups in http://sourcefrog.net/bzr/check-options
Martin Pool
mbp at sourcefrog.net
Wed Jul 11 03:32:39 BST 2007
At http://sourcefrog.net/bzr/check-options
------------------------------------------------------------
revno: 2602
revision-id: mbp at sourcefrog.net-20070711023238-3t8dcgltds9566ke
parent: mbp at sourcefrog.net-20070711015533-dzcxkjg0ujh8yuhl
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: check-options
timestamp: Wed 2007-07-11 12:32:38 +1000
message:
Fix up tests for option help cleanups
modified:
bzrlib/option.py option.py-20051014052914-661fb36e76e7362f
bzrlib/tests/blackbox/test_help.py test_help.py-20060216004358-4ee8a2a338f75a62
bzrlib/tests/test_help.py test_help.py-20070419045354-6q6rq15j9e2n5fna-1
bzrlib/tests/test_options.py testoptions.py-20051014093702-96457cfc86319a8f
=== modified file 'bzrlib/option.py'
--- a/bzrlib/option.py 2007-07-10 10:33:45 +0000
+++ b/bzrlib/option.py 2007-07-11 02:32:38 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005, 2006 Canonical Ltd
+# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -411,9 +411,11 @@
_global_registry_option('log-format', "Use specified log format.",
log.log_formatter_registry, value_switches=True,
title='Log format')
-_global_option('long', help='Use detailed log format. Same as --log-format long',
- short_name='l')
-_global_option('short', help='Use moderately short log format. Same as --log-format short')
+_global_option('long',
+ help='Use detailed log format. Same as --log-format long.',
+ short_name='l')
+_global_option('short',
+ help='Use moderately short log format. Same as --log-format short.')
_global_option('line', help='Use log format with one line per revision. Same as --log-format line.')
_global_option('root', type=str)
_global_option('no-backup')
=== modified file 'bzrlib/tests/blackbox/test_help.py'
--- a/bzrlib/tests/blackbox/test_help.py 2007-07-04 08:46:22 +0000
+++ b/bzrlib/tests/blackbox/test_help.py 2007-07-11 02:32:38 +0000
@@ -118,4 +118,5 @@
self.assertEquals(help, qmark)
for line in help.split('\n'):
if '--long' in line:
- self.assertTrue('show help on all commands' in line)
+ self.assertContainsRe(line,
+ r'Show help on all commands\.')
=== modified file 'bzrlib/tests/test_help.py'
--- a/bzrlib/tests/test_help.py 2007-04-23 00:24:53 +0000
+++ b/bzrlib/tests/test_help.py 2007-07-11 02:32:38 +0000
@@ -40,7 +40,7 @@
helptext = cmd.get_help_text()
self.assertEndsWith(
helptext,
- ' -h, --help show help message\n'
+ ' -h, --help Show help message.\n'
'\n'
'See also: bar, foo\n')
@@ -51,7 +51,7 @@
cmd = cmd_Demo()
helptext = cmd.get_help_text()
self.assertStartsWith(helptext, 'usage: bzr Demo')
- self.assertEndsWith(helptext, 'show help message\n')
+ self.assertEndsWith(helptext, 'Show help message.\n')
def test_command_with_additional_see_also(self):
class cmd_WithSeeAlso(commands.Command):
@@ -61,7 +61,7 @@
helptext = cmd.get_help_text(['gam'])
self.assertEndsWith(
helptext,
- ' -h, --help show help message\n'
+ ' -h, --help Show help message.\n'
'\n'
'See also: bar, foo, gam\n')
@@ -72,7 +72,7 @@
helptext = cmd.get_help_text(['gam'])
self.assertEndsWith(
helptext,
- ' -h, --help show help message\n'
+ ' -h, --help Show help message.\n'
'\n'
'See also: gam\n')
=== modified file 'bzrlib/tests/test_options.py'
--- a/bzrlib/tests/test_options.py 2007-07-10 10:33:45 +0000
+++ b/bzrlib/tests/test_options.py 2007-07-11 02:32:38 +0000
@@ -55,14 +55,14 @@
def test_option_help(self):
"""Options have help strings."""
out, err = self.run_bzr('commit --help')
- self.assertContainsRe(out, r'--file(.|\n)*file containing commit'
- ' message')
+ self.assertContainsRe(out,
+ r'--file(.|\n)*Take commit message from this file\.')
self.assertContainsRe(out, r'-h.*--help')
def test_option_help_global(self):
"""Global options have help strings."""
out, err = self.run_bzr('help status')
- self.assertContainsRe(out, r'--show-ids.*show internal object')
+ self.assertContainsRe(out, r'--show-ids.*Show internal object.')
def test_option_arg_help(self):
"""Help message shows option arguments."""
More information about the bazaar-commits
mailing list