test: Adjust run_command_list() to return a list of strings
authorSimon Glass <sjg@chromium.org>
Sun, 31 Jul 2016 23:35:09 +0000 (17:35 -0600)
committerTom Rini <trini@konsulko.com>
Sat, 6 Aug 2016 00:55:23 +0000 (20:55 -0400)
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>
test/py/tests/test_vboot.py
test/py/u_boot_console_base.py

index d7ab439b2bbb756f8753567fa1a4a8e51b89a0c0..021892bb3dac917458e95904e3336312aca45d2a 100644 (file)
@@ -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.
index b855b10ecc59221204d22282fe6d99531a3a1e17..ee9b928756fab9fd43d39c30c91de49a1083934e 100644 (file)
@@ -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):