Show More
@@ -77,44 +77,44 b' def foo(self, args):' | |||
|
77 | 77 | @parametric |
|
78 | 78 | def test_magic_arguments(): |
|
79 | 79 | # Ideally, these would be doctests, but I could not get it to work. |
|
80 | yield assert_equal(magic_foo1.__doc__, '%foo1 [-f FOO]\n\nA docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
80 | yield assert_equal(magic_foo1.__doc__, '%foo1 [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
81 | 81 | yield assert_equal(getattr(magic_foo1, 'argcmd_name', None), None) |
|
82 | 82 | yield assert_equal(real_name(magic_foo1), 'foo1') |
|
83 | 83 | yield assert_equal(magic_foo1(None, ''), argparse.Namespace(foo=None)) |
|
84 | 84 | yield assert_true(hasattr(magic_foo1, 'has_arguments')) |
|
85 | 85 | |
|
86 | yield assert_equal(magic_foo2.__doc__, '%foo2\n\nA docstring.\n') | |
|
86 | yield assert_equal(magic_foo2.__doc__, '%foo2\n\n A docstring.\n') | |
|
87 | 87 | yield assert_equal(getattr(magic_foo2, 'argcmd_name', None), None) |
|
88 | 88 | yield assert_equal(real_name(magic_foo2), 'foo2') |
|
89 | 89 | yield assert_equal(magic_foo2(None, ''), argparse.Namespace()) |
|
90 | 90 | yield assert_true(hasattr(magic_foo2, 'has_arguments')) |
|
91 | 91 | |
|
92 | yield assert_equal(magic_foo3.__doc__, '%foo3 [-f FOO] [-b BAR] [-z BAZ]\n\nA docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n\nGroup:\n -b BAR, --bar BAR a grouped argument\n\nSecond Group:\n -z BAZ, --baz BAZ another grouped argument\n') | |
|
92 | yield assert_equal(magic_foo3.__doc__, '%foo3 [-f FOO] [-b BAR] [-z BAZ]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n\nGroup:\n -b BAR, --bar BAR a grouped argument\n\nSecond Group:\n -z BAZ, --baz BAZ another grouped argument\n') | |
|
93 | 93 | yield assert_equal(getattr(magic_foo3, 'argcmd_name', None), None) |
|
94 | 94 | yield assert_equal(real_name(magic_foo3), 'foo3') |
|
95 | 95 | yield assert_equal(magic_foo3(None, ''), |
|
96 | 96 | argparse.Namespace(bar=None, baz=None, foo=None)) |
|
97 | 97 | yield assert_true(hasattr(magic_foo3, 'has_arguments')) |
|
98 | 98 | |
|
99 | yield assert_equal(magic_foo4.__doc__, '%foo4 [-f FOO]\n\nA docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
99 | yield assert_equal(magic_foo4.__doc__, '%foo4 [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
100 | 100 | yield assert_equal(getattr(magic_foo4, 'argcmd_name', None), None) |
|
101 | 101 | yield assert_equal(real_name(magic_foo4), 'foo4') |
|
102 | 102 | yield assert_equal(magic_foo4(None, ''), argparse.Namespace()) |
|
103 | 103 | yield assert_true(hasattr(magic_foo4, 'has_arguments')) |
|
104 | 104 | |
|
105 | yield assert_equal(magic_foo5.__doc__, '%frobnicate [-f FOO]\n\nA docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
105 | yield assert_equal(magic_foo5.__doc__, '%frobnicate [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
106 | 106 | yield assert_equal(getattr(magic_foo5, 'argcmd_name', None), 'frobnicate') |
|
107 | 107 | yield assert_equal(real_name(magic_foo5), 'frobnicate') |
|
108 | 108 | yield assert_equal(magic_foo5(None, ''), argparse.Namespace(foo=None)) |
|
109 | 109 | yield assert_true(hasattr(magic_foo5, 'has_arguments')) |
|
110 | 110 | |
|
111 | yield assert_equal(magic_magic_foo.__doc__, '%magic_foo [-f FOO]\n\nA docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
111 | yield assert_equal(magic_magic_foo.__doc__, '%magic_foo [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
112 | 112 | yield assert_equal(getattr(magic_magic_foo, 'argcmd_name', None), None) |
|
113 | 113 | yield assert_equal(real_name(magic_magic_foo), 'magic_foo') |
|
114 | 114 | yield assert_equal(magic_magic_foo(None, ''), argparse.Namespace(foo=None)) |
|
115 | 115 | yield assert_true(hasattr(magic_magic_foo, 'has_arguments')) |
|
116 | 116 | |
|
117 | yield assert_equal(foo.__doc__, '%foo [-f FOO]\n\nA docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
117 | yield assert_equal(foo.__doc__, '%foo [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') | |
|
118 | 118 | yield assert_equal(getattr(foo, 'argcmd_name', None), None) |
|
119 | 119 | yield assert_equal(real_name(foo), 'foo') |
|
120 | 120 | yield assert_equal(foo(None, ''), argparse.Namespace(foo=None)) |
General Comments 0
You need to be logged in to leave comments.
Login now