Use local man pages in tests

We need to set the value of `MANPATH` to the local man pages when running helper function 'run_cmd_wait_nofail'.
Use the already set Timewarrior environment for this.

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2023-04-14 13:50:35 +02:00
parent 57695d27f4
commit 70a1082224
2 changed files with 4 additions and 2 deletions

View file

@ -64,14 +64,14 @@ class TestHelp(TestCase):
def test_help_with_command_should_show_man_page(self):
"""timew help with command should show man page"""
_, expected, _ = run_cmd_wait_nofail(["man", "timew-start"])
_, expected, _ = run_cmd_wait_nofail(["man", "timew-start"], env=self.t.env)
_, actual, _ = self.t("help start")
self.assertEqual(actual, expected)
def test_help_with_unknown_argument_should_show_error_message(self):
"""timew help with unknown argument should show error message"""
_, _, expected = run_cmd_wait_nofail(["man", "timew-bogus"])
_, _, expected = run_cmd_wait_nofail(["man", "timew-bogus"], env=self.t.env)
_, _, actual = self.t.runError("help bogus")
self.assertEqual(actual, expected)