changeset 10141:827b7d6f9016

test-help: improve test coverage Adds a test for commands without help text. Extends test coverage of commands.help_ by 1 line.
author Henri Wiechers <hwiechers@gmail.com>
date Thu, 24 Dec 2009 18:53:35 +0200
parents 5d868e0565f6
children 44fa0e205ec9
files tests/test-help tests/test-help.out
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-help	Thu Dec 24 18:53:35 2009 +0200
+++ b/tests/test-help	Thu Dec 24 18:53:35 2009 +0200
@@ -27,4 +27,25 @@
 hg help foo
 hg skjdfks
 
+cat > helpext.py <<EOF
+import os
+from mercurial import commands
+
+def nohelp(ui, *args, **kwargs):
+    pass
+
+cmdtable = {
+    "nohelp": (nohelp, [], "hg nohelp"),
+}
+
+commands.norepo += ' nohelp'
+EOF
+abspath=`pwd`/helpext.py
+
+echo '[extensions]' >> $HGRCPATH
+echo "helpext = $abspath" >> $HGRCPATH
+
+echo %% test command with no help text
+hg help nohelp
+
 exit 0
--- a/tests/test-help.out	Thu Dec 24 18:53:35 2009 +0200
+++ b/tests/test-help.out	Thu Dec 24 18:53:35 2009 +0200
@@ -462,3 +462,9 @@
  update     update working directory
 
 use "hg help" for the full list of commands or "hg -v" for details
+%% test command with no help text
+hg nohelp
+
+(no help text available)
+
+use "hg -v help nohelp" to show global options