summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJerome M. BERGER <jerome.berger@sagemcom.com>2018-05-22 16:12:31 +0200
committerJerome M. BERGER <jerome.berger@sagemcom.com>2018-05-22 16:12:31 +0200
commitce1e181b4c6fbb88678bfa7da45b8a3da328ba2b (patch)
tree94c4f4e48a9b42a0743c92cd32f7dc8f3bfa4147 /tests
parent4507924a1ebd8b0677a0f67cb1f67eb531221241 (diff)
downloadpexpect-git-ce1e181b4c6fbb88678bfa7da45b8a3da328ba2b.tar.gz
Make `crlf` match the default platform behaviour in `PopenSpawn`. Fixes #488
Diffstat (limited to 'tests')
-rw-r--r--tests/test_popen_spawn.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_popen_spawn.py b/tests/test_popen_spawn.py
index 98046ed..fca7493 100644
--- a/tests/test_popen_spawn.py
+++ b/tests/test_popen_spawn.py
@@ -125,6 +125,14 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase):
p.expect_exact('def')
p.expect(pexpect.EOF)
+ def test_crlf(self):
+ p = PopenSpawn('echo alpha beta')
+ assert p.read() == b'alpha beta' + p.crlf
+
+ def test_crlf_encoding(self):
+ p = PopenSpawn('echo alpha beta', encoding='utf-8')
+ assert p.read() == 'alpha beta' + p.crlf
+
if __name__ == '__main__':
unittest.main()