Mercurial > piecrust2
changeset 493:95b77239c3b7
tests: Fix `find` tests on Windows.
We need to expect OS-appropriate path separators in the output.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 23 Jul 2015 22:08:21 -0700 |
parents | d90ccdf18156 |
children | 2537fe95d771 |
files | tests/cli/test_find.yaml tests/conftest.py |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/cli/test_find.yaml Thu Jul 23 22:07:32 2015 -0700 +++ b/tests/cli/test_find.yaml Thu Jul 23 22:08:21 2015 -0700 @@ -3,12 +3,14 @@ out: '' --- args: find +replace_out_path_sep: true in: pages/foo.md: '' out: | pages/foo.md --- args: find +replace_out_path_sep: true in: pages/foo.md: '' posts/2015-01-10_blah.md: '' @@ -17,6 +19,7 @@ posts/2015-01-10_blah.md --- args: find foo +replace_out_path_sep: true in: pages/foo.md: '' pages/bar.md: '' @@ -27,6 +30,7 @@ pages/foo/child.md --- args: find --exact *foo.md +replace_out_path_sep: true in: pages/foo.md: '' pages/bar.md: ''
--- a/tests/conftest.py Thu Jul 23 22:07:32 2015 -0700 +++ b/tests/conftest.py Thu Jul 23 22:08:21 2015 -0700 @@ -145,7 +145,11 @@ logging.getLogger().removeHandler(hdl) assert expected_code == exit_code - assert expected_out == memstream.getvalue() + + actual_out = memstream.getvalue() + if self.spec.get('replace_out_path_sep'): + expected_out = expected_out.replace('/', os.sep) + assert expected_out == actual_out def reportinfo(self): return self.fspath, 0, "bake: %s" % self.name