summaryrefslogtreecommitdiff
path: root/cliff/tests
diff options
context:
space:
mode:
authorDerek Higgins <derekh@redhat.com>2015-07-07 12:07:37 +0100
committerDerek Higgins <derekh@redhat.com>2015-07-07 12:12:24 +0100
commit9eca3d599e2d35f50fd7966588f364848d58aa0c (patch)
treefac2abc6ab8bf0de52cfc663608b65aeb7705e31 /cliff/tests
parentd9a0e8c7c16a2f3d8eae35c78c7b80194748426b (diff)
downloadcliff-9eca3d599e2d35f50fd7966588f364848d58aa0c.tar.gz
Use base command for help test
This test needs to compare against the actual command used to start the tests e.g. nosetests-3.4. Change-Id: I758f7c07b13817efdc8824c83f96c75ffb90eb4d
Diffstat (limited to 'cliff/tests')
-rw-r--r--cliff/tests/test_help.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cliff/tests/test_help.py b/cliff/tests/test_help.py
index 07bc6bc..3ee6fe5 100644
--- a/cliff/tests/test_help.py
+++ b/cliff/tests/test_help.py
@@ -2,6 +2,8 @@ try:
from StringIO import StringIO
except:
from io import StringIO
+import os
+import sys
import mock
@@ -89,7 +91,8 @@ def test_show_help_for_help():
except SystemExit:
pass
help_text = stdout.getvalue()
- assert 'usage: nosetests [--version]' in help_text
+ basecommand = os.path.split(sys.argv[0])[1]
+ assert 'usage: %s [--version]' % basecommand in help_text
assert 'optional arguments:\n --version' in help_text
assert 'one \n three word command \n' in help_text