From b3d7e0b3ba0cd0b62bb6101b3654b0dac93ae2a3 Mon Sep 17 00:00:00 2001 From: Michael Gummelt Date: Fri, 5 Jun 2015 11:59:16 -0700 Subject: [PATCH] truncated test output --- cli/tests/integrations/common.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cli/tests/integrations/common.py b/cli/tests/integrations/common.py index 6d658ac..4d17efa 100644 --- a/cli/tests/integrations/common.py +++ b/cli/tests/integrations/common.py @@ -33,12 +33,19 @@ def exec_command(cmd, env=None, stdin=None): stdout, stderr = process.communicate() # We should always print the stdout and stderr - print('STDOUT: {}'.format(stdout.decode('utf-8'))) - print('STDERR: {}'.format(stderr.decode('utf-8'))) + print('STDOUT: {}'.format(_truncate(stdout.decode('utf-8')))) + print('STDERR: {}'.format(_truncate(stderr.decode('utf-8')))) return (process.returncode, stdout, stderr) +def _truncate(s, length=8000): + if len(s) > length: + return s[:length-3] + '...' + else: + return s + + def assert_command( cmd, returncode=0,