8
8
import mock
9
9
except ImportError :
10
10
from unittest import mock
11
- from threading import Lock
12
11
13
12
from knack .arguments import ArgumentsContext
14
- from knack .commands import CLICommand , CLICommandsLoader , CommandGroup
13
+ from knack .commands import CLICommandsLoader , CommandGroup
15
14
16
- from tests .util import DummyCLI , redirect_io , disable_color
15
+ from tests .util import DummyCLI , redirect_io , assert_in_multi_line , disable_color
17
16
18
17
19
18
def example_handler (arg1 , arg2 = None , arg3 = None ):
@@ -80,7 +79,7 @@ def test_deprecate_command_group_help(self):
80
79
cmd4 [Deprecated] : Short summary here.
81
80
82
81
""" .format (self .cli_ctx .name )
83
- self . assertEqual (expected , actual )
82
+ assert_in_multi_line (expected , actual )
84
83
85
84
@redirect_io
86
85
def test_deprecate_command_help_hidden (self ):
@@ -100,7 +99,7 @@ def test_deprecate_command_help_hidden(self):
100
99
--arg -a : Allowed values: 1, 2, 3.
101
100
--arg3
102
101
""" .format (self .cli_ctx .name )
103
- self . assertIn (expected , actual )
102
+ assert_in_multi_line (expected , actual )
104
103
105
104
@redirect_io
106
105
def test_deprecate_command_plain_execute (self ):
@@ -211,7 +210,7 @@ def test_deprecate_command_group_help_plain(self):
211
210
cmd1 : Short summary here.
212
211
213
212
""" .format (self .cli_ctx .name )
214
- self . assertEqual (expected , actual )
213
+ assert_in_multi_line (expected , actual )
215
214
216
215
@redirect_io
217
216
def test_deprecate_command_group_help_hidden (self ):
@@ -229,7 +228,7 @@ def test_deprecate_command_group_help_hidden(self):
229
228
cmd1 : Short summary here.
230
229
231
230
""" .format (self .cli_ctx .name )
232
- self . assertIn (expected , actual )
231
+ assert_in_multi_line (expected , actual )
233
232
234
233
@redirect_io
235
234
def test_deprecate_command_group_help_expiring (self ):
@@ -243,7 +242,7 @@ def test_deprecate_command_group_help_expiring(self):
243
242
This command group has been deprecated and will be removed in version '1.0.0'. Use
244
243
'alt-group4' instead.
245
244
""" .format (self .cli_ctx .name )
246
- self . assertIn (expected , actual )
245
+ assert_in_multi_line (expected , actual )
247
246
248
247
@redirect_io
249
248
@disable_color
@@ -282,7 +281,7 @@ def test_deprecate_command_implicitly(self):
282
281
This command is implicitly deprecated because command group 'group1' is deprecated and
283
282
will be removed in a future release. Use 'alt-group1' instead.
284
283
""" .format (self .cli_ctx .name )
285
- self . assertIn (expected , actual )
284
+ assert_in_multi_line (expected , actual )
286
285
287
286
288
287
class TestArgumentDeprecation (unittest .TestCase ):
@@ -352,7 +351,7 @@ def test_deprecate_arguments_command_help(self):
352
351
--opt4
353
352
--opt5
354
353
""" .format (self .cli_ctx .name )
355
- self . assertTrue ( actual . startswith ( expected ) )
354
+ assert_in_multi_line ( expected , actual )
356
355
357
356
@redirect_io
358
357
def test_deprecate_arguments_execute (self ):
0 commit comments