Skip to content

Commit

Permalink
Adding tests expecting windows lineendings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jstenar committed Aug 26, 2012
1 parent fd8a171 commit 047f6bd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions IPython/testing/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ def test_main_path(self):
out = "A\nB"
tt.ipexec_validate(self.fname, out)

def test_main_path2(self):
"""Test with only stdout results, expecting windows line endings.
"""
self.mktmp("print('A')\n"
"print('B')\n"
)
out = "A\r\nB"
tt.ipexec_validate(self.fname, out)

def test_exception_path(self):
"""Test exception path in exception_validate.
"""
Expand All @@ -112,3 +121,16 @@ def test_exception_path(self):
)
out = "A\nB"
tt.ipexec_validate(self.fname, expected_out=out, expected_err="C\nD")

def test_exception_path(self):
"""Test exception path in exception_validate, expecting windows line endings.
"""
self.mktmp("from __future__ import print_function\n"
"import sys\n"
"print('A')\n"
"print('B')\n"
"print('C', file=sys.stderr)\n"
"print('D', file=sys.stderr)\n"
)
out = "A\r\nB"
tt.ipexec_validate(self.fname, expected_out=out, expected_err="C\r\nD")

0 comments on commit 047f6bd

Please sign in to comment.