Pārlūkot izejas kodu

Check borgfs man formatting in tests

I only realized after the first PR was merged that the code used for
finding which man pages to generate was duplicated in the testsuite
(since setup.py can't import from the installed module and vice versa.)
These are essentially the same changes as made to setup.py in #3290.
Milkey Mouse 7 gadi atpakaļ
vecāks
revīzija
0ec703ff40
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 5 2
      src/borg/testsuite/archiver.py

+ 5 - 2
src/borg/testsuite/archiver.py

@@ -3655,14 +3655,17 @@ def get_all_parsers():
     Return dict mapping command to parser.
     """
     parser = Archiver(prog='borg').build_parser()
+    borgfs_parser = Archiver(prog='borgfs').build_parser()
     parsers = {}
 
-    def discover_level(prefix, parser, Archiver):
+    def discover_level(prefix, parser, Archiver, extra_choices=None):
         choices = {}
         for action in parser._actions:
             if action.choices is not None and 'SubParsersAction' in str(action.__class__):
                 for cmd, parser in action.choices.items():
                     choices[prefix + cmd] = parser
+        if extra_choices is not None:
+            choices.update(extra_choices)
         if prefix and not choices:
             return
 
@@ -3670,7 +3673,7 @@ def get_all_parsers():
             discover_level(command + " ", parser, Archiver)
             parsers[command] = parser
 
-    discover_level("", parser, Archiver)
+    discover_level("", parser, Archiver, {'borgfs': borgfs_parser})
     return parsers