##// END OF EJS Templates
Update split_user_input unicode test.
Thomas Kluyver -
Show More
@@ -390,14 +390,6 b' def test_LineInfo():'
390 linfo = isp.LineInfo(' %cd /home')
390 linfo = isp.LineInfo(' %cd /home')
391 nt.assert_equals(str(linfo), 'LineInfo [ |%|cd|/home]')
391 nt.assert_equals(str(linfo), 'LineInfo [ |%|cd|/home]')
392
392
393
394 def test_split_user_input():
395 """Unicode test - split_user_input already has good doctests"""
396 line = u"Pérez Fernando"
397 parts_expected = (u'', u'', u'', line)
398 tt.check_pairs(isp.split_user_input, [(line, parts_expected),])
399
400
401 # Transformer tests
393 # Transformer tests
402 def transform_checker(tests, func):
394 def transform_checker(tests, func):
403 """Utility to loop over test inputs"""
395 """Utility to loop over test inputs"""
@@ -1,5 +1,7 b''
1 # coding: utf-8
1 from IPython.core.splitinput import split_user_input
2 from IPython.core.splitinput import split_user_input
2 from IPython.testing import tools as tt
3 from IPython.testing import tools as tt
4 from IPython.utils import py3compat
3
5
4 tests = [
6 tests = [
5 ('x=1', ('', '', 'x', '=1')),
7 ('x=1', ('', '', 'x', '=1')),
@@ -21,6 +23,10 b' tests = ['
21 ('?%hist', ('', '?', '%hist', '')),
23 ('?%hist', ('', '?', '%hist', '')),
22 ('?x*', ('', '?', 'x*', '')),
24 ('?x*', ('', '?', 'x*', '')),
23 ]
25 ]
26 if py3compat.PY3:
27 tests.append((u"Pérez Fernando", (u'', u'', u'Pérez', u'Fernando')))
28 else:
29 tests.append((u"Pérez Fernando", (u'', u'', u'P', u'érez Fernando')))
24
30
25 def test_split_user_input():
31 def test_split_user_input():
26 return tt.check_pairs(split_user_input, tests)
32 return tt.check_pairs(split_user_input, tests)
General Comments 0
You need to be logged in to leave comments. Login now