Browse Source

test: Adjust run_command_list() to return a list of strings

Return one string for each command that was executed. This seems cleaner.

Suggested-by: Teddy Reed <teddy.reed@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Simon Glass 8 years ago
parent
commit
f6d34651d8
2 changed files with 5 additions and 4 deletions
  1. 1 1
      test/py/tests/test_vboot.py
  2. 4 3
      test/py/u_boot_console_base.py

+ 1 - 1
test/py/tests/test_vboot.py

@@ -71,7 +71,7 @@ def test_vboot(u_boot_console):
                 ['sb load hostfs - 100 %stest.fit' % tmpdir,
                 'fdt addr 100',
                 'bootm 100'])
-        assert(expect_string in output)
+        assert(expect_string in ''.join(output))
 
     def make_fit(its):
         """Make a new FIT from the .its source file.

+ 4 - 3
test/py/u_boot_console_base.py

@@ -225,11 +225,12 @@ class ConsoleBase(object):
         Args:
             cmd: List of commands (each a string).
         Returns:
-            Combined output of all commands, as a string.
+            A list of output strings from each command, one element for each
+            command.
         """
-        output = ''
+        output = []
         for cmd in cmds:
-            output += self.run_command(cmd)
+            output.append(self.run_command(cmd))
         return output
 
     def ctrlc(self):