From cc79c98b985e4fb684ed7b3f4b3629dbcaae5dcb Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 12 Sep 2022 23:42:34 +0200 Subject: [PATCH] move help cmd tests to own module --- src/borg/testsuite/archiver/__init__.py | 11 ----------- src/borg/testsuite/archiver/help_cmd.py | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 src/borg/testsuite/archiver/help_cmd.py diff --git a/src/borg/testsuite/archiver/__init__.py b/src/borg/testsuite/archiver/__init__.py index 884d44b65..40e650428 100644 --- a/src/borg/testsuite/archiver/__init__.py +++ b/src/borg/testsuite/archiver/__init__.py @@ -1935,17 +1935,6 @@ def test_common_options(self): log = self.cmd(f"--repo={self.repository_location}", "--debug", "create", "test", "input") assert "security: read previous location" in log - def test_usage(self): - self.cmd() - self.cmd("-h") - - def test_help(self): - assert "Borg" in self.cmd("help") - assert "patterns" in self.cmd("help", "patterns") - assert "creates a new, empty repository" in self.cmd("help", "rcreate") - assert "positional arguments" not in self.cmd("help", "rcreate", "--epilog-only") - assert "creates a new, empty repository" not in self.cmd("help", "rcreate", "--usage-only") - def test_init_interrupt(self): def raise_eof(*args, **kwargs): raise EOFError diff --git a/src/borg/testsuite/archiver/help_cmd.py b/src/borg/testsuite/archiver/help_cmd.py new file mode 100644 index 000000000..1bab80880 --- /dev/null +++ b/src/borg/testsuite/archiver/help_cmd.py @@ -0,0 +1,15 @@ +from ...constants import * # NOQA +from . import ArchiverTestCaseBase + + +class ArchiverTestCase(ArchiverTestCaseBase): + def test_usage(self): + self.cmd() + self.cmd("-h") + + def test_help(self): + assert "Borg" in self.cmd("help") + assert "patterns" in self.cmd("help", "patterns") + assert "creates a new, empty repository" in self.cmd("help", "rcreate") + assert "positional arguments" not in self.cmd("help", "rcreate", "--epilog-only") + assert "creates a new, empty repository" not in self.cmd("help", "rcreate", "--usage-only")