list plugin: strip trailing whitespace from verbose ouput

The 'avocado list -V' prints the list of tests as a matrix with
Type, Test and Tag(s) columns. Some lines may get trailing
whitespace chars due the method used to align the columns' value.

Changed the call to avocado.utils.astring.iter_tabular_output()
so that trailing whitespace are removed from each row.

Adjusted the PluginsTest.test_list_no_file_loader() test due lack
of whitespace on outputs to be compared.

Reference: https://trello.com/c/JWeay87z/1045-strip-tabularoutput-linesSigned-off-by: NWainer dos Santos Moschetta <wainersm@redhat.com>
上级 2ff6a4f6
......@@ -94,7 +94,8 @@ class TestLister(object):
output.TERM_SUPPORT.header_str('Test'),
output.TERM_SUPPORT.header_str('Tag(s)'))
for line in astring.iter_tabular_output(test_matrix, header=header):
for line in astring.iter_tabular_output(test_matrix, header=header,
strip=True):
LOG_UI.debug(line)
if self.args.verbose:
......
......@@ -1028,7 +1028,7 @@ class PluginsTest(AbsPluginsTest, unittest.TestCase):
"Avocado did not return rc %d:\n%s"
% (exit_codes.AVOCADO_ALL_OK, result))
exp = (b"Type Test Tag(s)\n"
b"MISSING this-wont-be-matched \n\n"
b"MISSING this-wont-be-matched\n\n"
b"TEST TYPES SUMMARY\n"
b"==================\n"
b"EXTERNAL: 0\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册