##// END OF EJS Templates
[core][tests][splitinput] Remove nose
Samuel Gaist -
Show More
@@ -1,38 +1,38 b''
1 # coding: utf-8
1 # coding: utf-8
2 import nose.tools as nt
3
2
4 from IPython.core.splitinput import split_user_input, LineInfo
3 from IPython.core.splitinput import split_user_input, LineInfo
5 from IPython.testing import tools as tt
4 from IPython.testing import tools as tt
6
5
7 tests = [
6 tests = [
8 ('x=1', ('', '', 'x', '=1')),
7 ("x=1", ("", "", "x", "=1")),
9 ('?', ('', '?', '', '')),
8 ("?", ("", "?", "", "")),
10 ('??', ('', '??', '', '')),
9 ("??", ("", "??", "", "")),
11 (' ?', (' ', '?', '', '')),
10 (" ?", (" ", "?", "", "")),
12 (' ??', (' ', '??', '', '')),
11 (" ??", (" ", "??", "", "")),
13 ('??x', ('', '??', 'x', '')),
12 ("??x", ("", "??", "x", "")),
14 ('?x=1', ('', '?', 'x', '=1')),
13 ("?x=1", ("", "?", "x", "=1")),
15 ('!ls', ('', '!', 'ls', '')),
14 ("!ls", ("", "!", "ls", "")),
16 (' !ls', (' ', '!', 'ls', '')),
15 (" !ls", (" ", "!", "ls", "")),
17 ('!!ls', ('', '!!', 'ls', '')),
16 ("!!ls", ("", "!!", "ls", "")),
18 (' !!ls', (' ', '!!', 'ls', '')),
17 (" !!ls", (" ", "!!", "ls", "")),
19 (',ls', ('', ',', 'ls', '')),
18 (",ls", ("", ",", "ls", "")),
20 (';ls', ('', ';', 'ls', '')),
19 (";ls", ("", ";", "ls", "")),
21 (' ;ls', (' ', ';', 'ls', '')),
20 (" ;ls", (" ", ";", "ls", "")),
22 ('f.g(x)', ('', '', 'f.g', '(x)')),
21 ("f.g(x)", ("", "", "f.g", "(x)")),
23 ('f.g (x)', ('', '', 'f.g', '(x)')),
22 ("f.g (x)", ("", "", "f.g", "(x)")),
24 ('?%hist1', ('', '?', '%hist1', '')),
23 ("?%hist1", ("", "?", "%hist1", "")),
25 ('?%%hist2', ('', '?', '%%hist2', '')),
24 ("?%%hist2", ("", "?", "%%hist2", "")),
26 ('??%hist3', ('', '??', '%hist3', '')),
25 ("??%hist3", ("", "??", "%hist3", "")),
27 ('??%%hist4', ('', '??', '%%hist4', '')),
26 ("??%%hist4", ("", "??", "%%hist4", "")),
28 ('?x*', ('', '?', 'x*', '')),
27 ("?x*", ("", "?", "x*", "")),
29 ]
28 ]
30 tests.append((u"Pérez Fernando", (u'', u'', u'Pérez', u'Fernando')))
29 tests.append(("Pérez Fernando", ("", "", "Pérez", "Fernando")))
30
31
31
32 def test_split_user_input():
32 def test_split_user_input():
33 return tt.check_pairs(split_user_input, tests)
33 return tt.check_pairs(split_user_input, tests)
34
34
35 def test_LineInfo():
35 def test_LineInfo():
36 """Simple test for LineInfo construction and str()"""
36 """Simple test for LineInfo construction and str()"""
37 linfo = LineInfo(' %cd /home')
37 linfo = LineInfo(" %cd /home")
38 nt.assert_equal(str(linfo), 'LineInfo [ |%|cd|/home]')
38 assert str(linfo) == "LineInfo [ |%|cd|/home]"
General Comments 0
You need to be logged in to leave comments. Login now