File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,35 @@ def thing():
166
166
167
167
self ._assert_correct_output (root , expected_output )
168
168
169
+ def test_hidden_command (self ):
170
+ major_version = int (click .__version__ .split ('.' )[0 ])
171
+ if major_version < 7 :
172
+ return
173
+
174
+ @click .group (name = 'root' )
175
+ def root ():
176
+ pass
177
+
178
+ @root .command (name = 'command-one' )
179
+ def command_one ():
180
+ pass
181
+
182
+ @root .command (name = 'command-two' , hidden = True )
183
+ def command_two ():
184
+ pass
185
+
186
+ @root .command (name = 'command-three' )
187
+ def command_three ():
188
+ pass
189
+
190
+ expected_output = """
191
+ root
192
+ ├── command-one
193
+ └── command-three
194
+ """ [1 :]
195
+
196
+ self ._assert_correct_output (root , expected_output )
197
+
169
198
def _assert_correct_output (self , root , expected_output ):
170
199
with captured_output () as (out , err ):
171
200
tree = _build_command_tree (root )
You can’t perform that action at this time.
0 commit comments