@@ -33,16 +33,16 @@ def urlify(s: str, true_length: int) -> str:
33
33
class TestUrlifyFunction (unittest .TestCase ):
34
34
def _run_tests (self , f : Callable [[str , int ], str ]) -> None :
35
35
cases = [
36
- ("Mr John Smith " , 13 , "Mr%20John%20Smith" ),
37
- ("Miguel Hernandez" , 16 , "Miguel%20Hernandez" ),
38
- (" Techqueria " , 11 , "%20Techqueria" ),
39
- ("a b c d e f g h" , 15 , "a%20b%20c%20d%20e%20f%20g%20h" ),
40
- ("a b c d e f g h ignore this" , 15 , "a%20b%20c%20d%20e%20f%20g%20h" ),
41
- ("ihavenospaces" , 13 , "ihavenospaces" ),
42
- ("nospacesIgnoreme" , 8 , "nospaces" )
36
+ (( "Mr John Smith " , 13 ) , "Mr%20John%20Smith" ),
37
+ (( "Miguel Hernandez" , 16 ) , "Miguel%20Hernandez" ),
38
+ (( " Techqueria " , 11 ) , "%20Techqueria" ),
39
+ (( "a b c d e f g h" , 15 ) , "a%20b%20c%20d%20e%20f%20g%20h" ),
40
+ (( "a b c d e f g h ignore this" , 15 ) , "a%20b%20c%20d%20e%20f%20g%20h" ),
41
+ (( "ihavenospaces" , 13 ) , "ihavenospaces" ),
42
+ (( "nospacesIgnoreme" , 8 ) , "nospaces" )
43
43
]
44
- for case in cases :
45
- self .assertEqual (f (case [ 0 ], case [ 1 ] ), case [ 2 ] , msg = case )
44
+ for args , expected in cases :
45
+ self .assertEqual (f (* args ), expected , msg = args )
46
46
47
47
def test_urlify (self ):
48
48
self ._run_tests (urlify )
0 commit comments