diff options
author | Daniel Kutik <daniel.kutik@lavawerk.com> | 2022-11-27 13:42:50 +0100 |
---|---|---|
committer | Daniel Kutik <daniel.kutik@lavawerk.com> | 2022-11-28 06:39:31 +0000 |
commit | e287fa760bb783a54a0299998cfba585356868fc (patch) | |
tree | a3b2a49e6190d3169513e0e1265d9cf3adf14fc7 | |
parent | 3593a10643a42596f2531240979fb59149804d48 (diff) | |
download | git-repo-e287fa760bb783a54a0299998cfba585356868fc.tar.gz |
test_capture: allow both Unix and Windows line sep
On Linux/macOS we allow \n in the end of the line.
On Windows we allow both \r\n and \n. Here we also allow Unix line
seperators as tests might be excuted in for example git-shell.
Change-Id: I3975b563cf95407da92e5479980e670eb748b30e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353181
Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
-rw-r--r-- | tests/test_wrapper.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 8447bec1..f77ae1ef 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py | |||
@@ -159,7 +159,9 @@ class RunCommand(RepoWrapperTestCase): | |||
159 | def test_capture(self): | 159 | def test_capture(self): |
160 | """Check capture_output handling.""" | 160 | """Check capture_output handling.""" |
161 | ret = self.wrapper.run_command(['echo', 'hi'], capture_output=True) | 161 | ret = self.wrapper.run_command(['echo', 'hi'], capture_output=True) |
162 | self.assertEqual(ret.stdout, 'hi\n') | 162 | # echo command appends OS specific linesep, but on Windows + Git Bash |
163 | # we get UNIX ending, so we allow both. | ||
164 | self.assertIn(ret.stdout, ['hi' + os.linesep, 'hi\n']) | ||
163 | 165 | ||
164 | def test_check(self): | 166 | def test_check(self): |
165 | """Check check handling.""" | 167 | """Check check handling.""" |