##// END OF EJS Templates
match rl encoding in frontend test
MinRK -
Show More
@@ -16,6 +16,7 b' Authors'
16 # Imports
16 # Imports
17 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
18 # stdlib
18 # stdlib
19 import sys
19 import unittest
20 import unittest
20
21
21 from IPython.testing.decorators import skipif
22 from IPython.testing.decorators import skipif
@@ -127,7 +128,8 b' class InteractiveShellTestCase(unittest.TestCase):'
127 hist = self.rl_hist_entries(ip.readline, 3)
128 hist = self.rl_hist_entries(ip.readline, 3)
128 expected = [u'line0', u'l€ne1\nline2', u'l€ne3\nline4']
129 expected = [u'line0', u'l€ne1\nline2', u'l€ne3\nline4']
129 # perform encoding, in case of casting due to ASCII locale
130 # perform encoding, in case of casting due to ASCII locale
130 expected = [ py3compat.unicode_to_str(e) for e in expected ]
131 enc = sys.stdin.encoding or "utf-8"
132 expected = [ py3compat.unicode_to_str(e, enc) for e in expected ]
131 self.assertEquals(hist, expected)
133 self.assertEquals(hist, expected)
132
134
133
135
@@ -164,5 +166,6 b' class InteractiveShellTestCase(unittest.TestCase):'
164 # expect no empty cells in history
166 # expect no empty cells in history
165 expected = [u'line0', u'l€ne1\nline2', u'l€ne3', u'line4']
167 expected = [u'line0', u'l€ne1\nline2', u'l€ne3', u'line4']
166 # perform encoding, in case of casting due to ASCII locale
168 # perform encoding, in case of casting due to ASCII locale
167 expected = [ py3compat.unicode_to_str(e) for e in expected ]
169 enc = sys.stdin.encoding or "utf-8"
170 expected = [ py3compat.unicode_to_str(e, enc) for e in expected ]
168 self.assertEquals(hist, expected)
171 self.assertEquals(hist, expected)
General Comments 0
You need to be logged in to leave comments. Login now