##// END OF EJS Templates
de-decorate help output tests
MinRK -
Show More
@@ -11,57 +11,45 b''
11 # Imports
11 # Imports
12 #-----------------------------------------------------------------------------
12 #-----------------------------------------------------------------------------
13
13
14 from IPython.testing.tools import help, help_all
14 import IPython.testing.tools as tt
15
15
16 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17 # Tests
17 # Tests
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19
19
20
20
21 @help()
22 def test_ipython_help():
21 def test_ipython_help():
23 pass
22 tt.help_output_test()
24
23
25 @help_all()
26 def test_ipython_help_all():
24 def test_ipython_help_all():
27 pass
25 tt.help_all_output_test()
28
26
29 @help("profile")
30 def test_profile_help():
27 def test_profile_help():
31 pass
28 tt.help_output_test("profile")
32
29
33 @help_all("profile")
34 def test_profile_help_all():
30 def test_profile_help_all():
35 pass
31 tt.help_all_output_test("profile")
36
32
37 @help("profile list")
38 def test_profile_list_help():
33 def test_profile_list_help():
39 pass
34 tt.help_output_test("profile list")
40
35
41 @help_all("profile list")
42 def test_profile_list_help_all():
36 def test_profile_list_help_all():
43 pass
37 tt.help_all_output_test("profile list")
44
38
45 @help("profile create")
46 def test_profile_create_help():
39 def test_profile_create_help():
47 pass
40 tt.help_output_test("profile create")
48
41
49 @help_all("profile create")
50 def test_profile_create_help_all():
42 def test_profile_create_help_all():
51 pass
43 tt.help_all_output_test("profile create")
52
44
53 @help("locate")
54 def test_locate_help():
45 def test_locate_help():
55 pass
46 tt.help_output_test("locate")
56
47
57 @help_all("locate")
58 def test_locate_help_all():
48 def test_locate_help_all():
59 pass
49 tt.help_all_output_test("locate")
60
50
61 @help("locate profile")
62 def test_locate_profile_help():
51 def test_locate_profile_help():
63 pass
52 tt.help_output_test("locate profile")
64
53
65 @help_all("locate profile")
66 def test_locate_profile_all():
54 def test_locate_profile_all():
67 pass
55 tt.help_all_output_test("locate profile")
@@ -433,33 +433,3 b" def help_all_output_test(subcommand=''):"
433 nt.assert_in("Class parameters", out)
433 nt.assert_in("Class parameters", out)
434 return out, err
434 return out, err
435
435
436
437 def help(cmd=''):
438 """decorator for making a test for `ipython cmd -h`"""
439 def wrap_help_test(f):
440 def test_help_output():
441 out, err = help_output_test(cmd)
442 if inspect.getargspec(f).args:
443 return f(out, err)
444 else:
445 return f()
446 cmds = cmd + ' ' if cmd else ''
447 test_help_output.__doc__ = "ipython {cmds}--help-all works".format(cmds=cmds)
448
449 return test_help_output
450 return wrap_help_test
451
452
453 def help_all(cmd=''):
454 """decorator for making a test for `ipython [cmd] --help-all`"""
455 def wrap_help_test(f):
456 def test_help_output():
457 out, err = help_all_output_test(cmd)
458 if inspect.getargspec(f).args:
459 return f(out, err)
460 else:
461 return f()
462 cmds = cmd + ' ' if cmd else ''
463 test_help_output.__doc__ = "ipython {cmds}--help-all works".format(cmds=cmds)
464 return test_help_output
465 return wrap_help_test
General Comments 0
You need to be logged in to leave comments. Login now