changeset 779:982de61e7da9

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.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 16 Jul 2016 15:04:36 +0200
parents 5e91bc0e3b4d
children ebf66b8b83f7
files tests/cli/test_showconfig.yaml tests/conftest.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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/
 
--- 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