File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,10 @@ def mk_rst_table(titles, columns):
258258 """
259259 Returns an rst table with given titles and columns (a nested list of string columns for each column)
260260 """
261+ # take into account that passed values may be iterators produced via 'map'
262+ titles = list (titles )
263+ columns = list (columns )
264+
261265 title_cnt , col_cnt = len (titles ), len (columns )
262266 if title_cnt != col_cnt :
263267 msg = "Number of titles/columns should be equal, found %d titles and %d columns" % (title_cnt , col_cnt )
Original file line number Diff line number Diff line change @@ -174,6 +174,26 @@ def test_help_long(self):
174174 regex = re .compile ("default: True; disable with --disable-cleanup-builddir" , re .M )
175175 self .assertTrue (regex .search (outtxt ), "Pattern '%s' found in: %s" % (regex .pattern , outtxt ))
176176
177+ def test_help_rst (self ):
178+ """Test generating --help in RST output format."""
179+
180+ self .mock_stderr (True )
181+ self .mock_stdout (True )
182+ self .eb_main (['--help=rst' ], raise_error = True )
183+ stderr , stdout = self .get_stderr (), self .get_stdout ()
184+ self .mock_stderr (False )
185+ self .mock_stdout (False )
186+
187+ self .assertFalse (stderr )
188+
189+ patterns = [
190+ r"^Basic options\n-------------" ,
191+ r"^``--fetch``[ ]*Allow downloading sources" ,
192+ ]
193+ for pattern in patterns :
194+ regex = re .compile (pattern , re .M )
195+ self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
196+
177197 def test_no_args (self ):
178198 """Test using no arguments."""
179199
You can’t perform that action at this time.
0 commit comments