@@ -50,7 +50,7 @@ def __eq__(self, other: float) -> bool:
50
50
return other == pie ()
51
51
52
52
for class_or_function in [pie , Pie , PieDataclass ]:
53
- self .assertEqual (tapify (class_or_function , args = []), 3.14 )
53
+ self .assertEqual (tapify (class_or_function , command_line_args = []), 3.14 )
54
54
55
55
def test_tapify_simple_types (self ):
56
56
def concat (a : int , simple : str , test : float , of : float , types : bool ) -> str :
@@ -75,7 +75,7 @@ def __eq__(self, other: str) -> bool:
75
75
return other == concat (self .a , self .simple , self .test , self .of , self .types )
76
76
77
77
for class_or_function in [concat , Concat , ConcatDataclass ]:
78
- output = tapify (class_or_function , args = [
78
+ output = tapify (class_or_function , command_line_args = [
79
79
'--a' , '1' ,
80
80
'--simple' , 'simple' ,
81
81
'--test' , '3.14' ,
@@ -109,7 +109,7 @@ def __eq__(self, other: str) -> bool:
109
109
return other == concat (self .a , self .simple , self .test , self .of , self .types , self .wow )
110
110
111
111
for class_or_function in [concat , Concat , ConcatDataclass ]:
112
- output = tapify (class_or_function , args = [
112
+ output = tapify (class_or_function , command_line_args = [
113
113
'--a' , '1' ,
114
114
'--simple' , 'simple' ,
115
115
'--test' , '3.14' ,
@@ -140,7 +140,7 @@ def __eq__(self, other: str) -> bool:
140
140
return other == concat (self .complexity , self .requires , self .intelligence )
141
141
142
142
for class_or_function in [concat , Concat , ConcatDataclass ]:
143
- output = tapify (class_or_function , args = [
143
+ output = tapify (class_or_function , command_line_args = [
144
144
'--complexity' , 'complex' , 'things' , 'require' ,
145
145
'--requires' , '1' , '0' ,
146
146
'--intelligence' , 'jesse' ,
@@ -171,7 +171,7 @@ def __eq__(self, other: str) -> bool:
171
171
return other == concat (self .complexity , self .requires , self .intelligence )
172
172
173
173
for class_or_function in [concat , Concat , ConcatDataclass ]:
174
- output = tapify (class_or_function , args = [
174
+ output = tapify (class_or_function , command_line_args = [
175
175
'--complexity' , '1' , '2' , '3' ,
176
176
'--requires' , '1' , '0' ,
177
177
'--intelligence' , 'jesse' ,
@@ -211,7 +211,7 @@ def __eq__(self, other: str) -> bool:
211
211
return other == concat (self .complexity , self .requires , self .intelligence , self .maybe , self .possibly )
212
212
213
213
for class_or_function in [concat , Concat , ConcatDataclass ]:
214
- output = tapify (class_or_function , args = [
214
+ output = tapify (class_or_function , command_line_args = [
215
215
'--complexity' , 'complex' , 'things' , 'require' ,
216
216
'--requires' , '-3' , '12' ,
217
217
'--possibly' , 'huh?'
@@ -241,7 +241,7 @@ def __eq__(self, other: str) -> bool:
241
241
242
242
for class_or_function in [concat , Concat , ConcatDataclass ]:
243
243
with self .assertRaises (SystemExit ):
244
- tapify (class_or_function , args = [
244
+ tapify (class_or_function , command_line_args = [
245
245
'--so' , '23' ,
246
246
'--many' , '9.3'
247
247
])
@@ -267,7 +267,7 @@ def __eq__(self, other: str) -> bool:
267
267
268
268
for class_or_function in [concat , Concat , ConcatDataclass ]:
269
269
with self .assertRaises (SystemExit ):
270
- tapify (class_or_function , args = [
270
+ tapify (class_or_function , command_line_args = [
271
271
'--so' , '23' ,
272
272
'--few' , '9.3' ,
273
273
'--args' , 'wow'
@@ -293,7 +293,7 @@ def __eq__(self, other: str) -> bool:
293
293
return other == concat (self .so , self .few )
294
294
295
295
for class_or_function in [concat , Concat , ConcatDataclass ]:
296
- output = tapify (class_or_function , args = [
296
+ output = tapify (class_or_function , command_line_args = [
297
297
'--so' , '23' ,
298
298
'--few' , '9.3' ,
299
299
'--args' , 'wow'
@@ -325,7 +325,7 @@ def __eq__(self, other: str) -> bool:
325
325
return other == concat (self .i , self .like , self .k , self .w , self .args , self .always )
326
326
327
327
for class_or_function in [concat , Concat , ConcatDataclass ]:
328
- output = tapify (class_or_function , args = [
328
+ output = tapify (class_or_function , command_line_args = [
329
329
'--i' , '23' ,
330
330
'--args' , 'wow' ,
331
331
'--like' , '3.03' ,
@@ -358,7 +358,7 @@ def __eq__(self, other: str) -> bool:
358
358
359
359
for class_or_function in [concat , Concat , ConcatDataclass ]:
360
360
with self .assertRaises (ValueError ):
361
- tapify (class_or_function , args = [
361
+ tapify (class_or_function , command_line_args = [
362
362
'--i' , '23' ,
363
363
'--args' , 'wow' ,
364
364
'--like' , '3.03' ,
@@ -383,12 +383,12 @@ def __eq__(self, other: str) -> bool:
383
383
return other == concat (self .problems )
384
384
385
385
for class_or_function in [concat , Concat , ConcatDataclass ]:
386
- output = tapify (class_or_function , args = [], problems = Problems ('oh' , 'no!' ))
386
+ output = tapify (class_or_function , command_line_args = [], problems = Problems ('oh' , 'no!' ))
387
387
388
388
self .assertEqual (output , 'Problems(oh, no!)' )
389
389
390
390
with self .assertRaises (SystemExit ):
391
- tapify (class_or_function , args = ['--problems' , '1' , '2' ])
391
+ tapify (class_or_function , command_line_args = ['--problems' , '1' , '2' ])
392
392
393
393
def test_tapify_untyped (self ):
394
394
def concat (untyped_1 , typed_1 : int ,
@@ -422,7 +422,7 @@ def __eq__(self, other: str) -> bool:
422
422
self .untyped_3 , self .typed_3 )
423
423
424
424
for class_or_function in [concat , Concat , ConcatDataclass ]:
425
- output = tapify (class_or_function , args = [
425
+ output = tapify (class_or_function , command_line_args = [
426
426
'--untyped_1' , 'why not type?' ,
427
427
'--typed_1' , '1' ,
428
428
'--typed_2' , 'typing is great!' ,
@@ -458,8 +458,8 @@ def __eq__(self, other: str) -> bool:
458
458
return other == concat (self .a , self .b , self .c )
459
459
460
460
for class_or_function in [concat , Concat , ConcatDataclass ]:
461
- output_1 = tapify (class_or_function , args = ['--a' , '1' , '--b' , '2' , '--c' , '3' ])
462
- output_2 = tapify (class_or_function , args = ['--a' , '4' , '--b' , '5' , '--c' , '6' ])
461
+ output_1 = tapify (class_or_function , command_line_args = ['--a' , '1' , '--b' , '2' , '--c' , '3' ])
462
+ output_2 = tapify (class_or_function , command_line_args = ['--a' , '4' , '--b' , '5' , '--c' , '6' ])
463
463
464
464
self .assertEqual (output_1 , '1 2 3' )
465
465
self .assertEqual (output_2 , '4 5 6' )
@@ -480,7 +480,7 @@ def __eq__(self, other: str) -> bool:
480
480
481
481
for class_or_function in [concat , Concat ]:
482
482
with self .assertRaises (SystemExit ):
483
- tapify (class_or_function , args = ['--a' , '1' , '--b' , '2' ])
483
+ tapify (class_or_function , command_line_args = ['--a' , '1' , '--b' , '2' ])
484
484
485
485
def test_tapify_help (self ):
486
486
def concat (a : int , b : int , c : int ) -> str :
@@ -524,7 +524,7 @@ def __eq__(self, other: str) -> bool:
524
524
f = io .StringIO ()
525
525
with contextlib .redirect_stdout (f ):
526
526
with self .assertRaises (SystemExit ):
527
- tapify (class_or_function , args = ['-h' ])
527
+ tapify (class_or_function , command_line_args = ['-h' ])
528
528
529
529
self .assertIn ('Concatenate three numbers.' , f .getvalue ())
530
530
self .assertIn ('--a A (int, required) The first number.' , f .getvalue ())
0 commit comments