mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Compare output of command help with unknown argument with corresponding output of man command
The error message may be different depending on the man tool used. Therefore, instead of hard-coding it into the test, ensure it is the same as produced by the man command Closes #512 Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
a38ecf6380
commit
d8b7080dcb
1 changed files with 5 additions and 2 deletions
|
@ -34,6 +34,7 @@ import unittest
|
|||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Timew, TestCase
|
||||
from basetest.utils import run_cmd_wait_nofail
|
||||
|
||||
|
||||
class TestHelp(TestCase):
|
||||
|
@ -66,8 +67,10 @@ class TestHelp(TestCase):
|
|||
|
||||
def test_help_with_unknown_argument_should_show_error_message(self):
|
||||
"""timew help with unknown argument should show error message"""
|
||||
code, out, err = self.t.runError("help bogus")
|
||||
self.assertRegex(err, r"No manual entry for timew-bogus")
|
||||
_, _, expected = run_cmd_wait_nofail(["man", "timew-bogus"])
|
||||
_, _, actual = self.t.runError("help bogus")
|
||||
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
def test_command_with_help_long_option_should_show_help_page(self):
|
||||
"""timew command with --help should show help page"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue