aboutsummaryrefslogtreecommitdiff
path: root/tools/binman
diff options
context:
space:
mode:
authorTom Rini2018-01-16 15:29:50 -0500
committerTom Rini2018-01-16 16:15:25 -0500
commit3759df0c0810636b31fe64c56868aa831514e509 (patch)
treee0716dec146d7a15295e6e6d0d645d3f8f5bc676 /tools/binman
parent23b4cf32b7ed9e2cd35638878d7c9ccd7537c7ba (diff)
tools: Update python "help" tests to cope with "more" oddities
In some cases when "more" is told to page a given file it will prepend the output with: :::::::::::::: /PATH/TO/THE/FILE :::::::::::::: And when this happens the output will not match the expected length. Further, if we use a different pager we will instead fail the coverage tests as we will not have 100% coverage. Update the help test to remove the string in question. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/binman')
-rw-r--r--tools/binman/ftest.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 5812ab397cf..b0832da08a4 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -290,7 +290,10 @@ class TestFunctional(unittest.TestCase):
"""Test that the full help is displayed with -H"""
result = self._RunBinman('-H')
help_file = os.path.join(self._binman_dir, 'README')
- self.assertEqual(len(result.stdout), os.path.getsize(help_file))
+ # Remove possible extraneous strings
+ extra = '::::::::::::::\n' + help_file + '\n::::::::::::::\n'
+ gothelp = result.stdout.replace(extra, '')
+ self.assertEqual(len(gothelp), os.path.getsize(help_file))
self.assertEqual(0, len(result.stderr))
self.assertEqual(0, result.return_code)