Show More
@@ -19,6 +19,7 Authors | |||||
19 | import unittest |
|
19 | import unittest | |
20 |
|
20 | |||
21 | from IPython.testing.decorators import skipif |
|
21 | from IPython.testing.decorators import skipif | |
|
22 | from IPython.utils import py3compat | |||
22 |
|
23 | |||
23 | class InteractiveShellTestCase(unittest.TestCase): |
|
24 | class InteractiveShellTestCase(unittest.TestCase): | |
24 | def rl_hist_entries(self, rl, n): |
|
25 | def rl_hist_entries(self, rl, n): | |
@@ -124,7 +125,10 class InteractiveShellTestCase(unittest.TestCase): | |||||
124 | self.assertEquals(ip.readline.get_current_history_length(), |
|
125 | self.assertEquals(ip.readline.get_current_history_length(), | |
125 | hlen_b4_cell) |
|
126 | hlen_b4_cell) | |
126 | hist = self.rl_hist_entries(ip.readline, 3) |
|
127 | hist = self.rl_hist_entries(ip.readline, 3) | |
127 |
|
|
128 | expected = [u'line0', u'l€ne1\nline2', u'l€ne3\nline4'] | |
|
129 | # perform encoding, in case of casting due to ASCII locale | |||
|
130 | expected = [ py3compat.unicode_to_str(e) for e in expected ] | |||
|
131 | self.assertEquals(hist, expected) | |||
128 |
|
132 | |||
129 |
|
133 | |||
130 | @skipif(not get_ipython().has_readline, 'no readline') |
|
134 | @skipif(not get_ipython().has_readline, 'no readline') | |
@@ -158,4 +162,7 class InteractiveShellTestCase(unittest.TestCase): | |||||
158 | hlen_b4_cell) |
|
162 | hlen_b4_cell) | |
159 | hist = self.rl_hist_entries(ip.readline, 4) |
|
163 | hist = self.rl_hist_entries(ip.readline, 4) | |
160 | # expect no empty cells in history |
|
164 | # expect no empty cells in history | |
161 |
|
|
165 | expected = [u'line0', u'l€ne1\nline2', u'l€ne3', u'line4'] | |
|
166 | # perform encoding, in case of casting due to ASCII locale | |||
|
167 | expected = [ py3compat.unicode_to_str(e) for e in expected ] | |||
|
168 | self.assertEquals(hist, expected) |
General Comments 0
You need to be logged in to leave comments.
Login now