# HG changeset patch # User Ludovic Chabant # Date 1468674276 -7200 # Node ID 982de61e7da910bcddb23e1a5d44df043a5106bd # Parent 5e91bc0e3b4deec64a1a34dcfff25f864ca9be90 tests: Fix some CLI tests. Add auto-stripping of newlines in the CLI output for tests that use the simple YAML string value for the expected output. Also, fix `showconfig` test to expect a root URL with a trailing slash. diff -r 5e91bc0e3b4d -r 982de61e7da9 tests/cli/test_showconfig.yaml --- a/tests/cli/test_showconfig.yaml Sat Jul 16 15:02:24 2016 +0200 +++ b/tests/cli/test_showconfig.yaml Sat Jul 16 15:04:36 2016 +0200 @@ -5,5 +5,5 @@ site: root: /something args: showconfig site/root -out: /something +out: /something/ diff -r 5e91bc0e3b4d -r 982de61e7da9 tests/conftest.py --- a/tests/conftest.py Sat Jul 16 15:02:24 2016 +0200 +++ b/tests/conftest.py Sat Jul 16 15:04:36 2016 +0200 @@ -215,6 +215,9 @@ if expected_out is not None: actual_out = memstream.getvalue() + if not self.spec.get('no_strip'): + actual_out = actual_out.rstrip(' \n') + expected_out = expected_out.rstrip(' \n') if self.spec.get('replace_out_path_sep'): expected_out = expected_out.replace('/', os.sep) assert expected_out == actual_out