Parcourir la source

move help cmd tests to own module

Thomas Waldmann il y a 2 ans
Parent
commit
cc79c98b98
2 fichiers modifiés avec 15 ajouts et 11 suppressions
  1. 0 11
      src/borg/testsuite/archiver/__init__.py
  2. 15 0
      src/borg/testsuite/archiver/help_cmd.py

+ 0 - 11
src/borg/testsuite/archiver/__init__.py

@@ -1935,17 +1935,6 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         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

+ 15 - 0
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")