@@ -347,7 +347,7 @@ def test_ListAction(self) -> None:
347
347
"""Test the Action() factory's creation of ListAction objects."""
348
348
349
349
a1 = SCons .Action .Action (["x" , "y" , "z" , ["a" , "b" , "c" ]])
350
- assert isinstance (a1 , SCons .Action .ListAction ), a1
350
+ assert isinstance (a1 , SCons .Action .ListAction ), f"a1 is { type ( a1 ) } "
351
351
assert a1 .varlist == (), a1 .varlist
352
352
assert isinstance (a1 .list [0 ], SCons .Action .CommandAction ), a1 .list [0 ]
353
353
assert a1 .list [0 ].cmd_list == "x" , a1 .list [0 ].cmd_list
@@ -359,7 +359,7 @@ def test_ListAction(self) -> None:
359
359
assert a1 .list [3 ].cmd_list == ["a" , "b" , "c" ], a1 .list [3 ].cmd_list
360
360
361
361
a2 = SCons .Action .Action ("x\n y\n z" )
362
- assert isinstance (a2 , SCons .Action .ListAction ), a2
362
+ assert isinstance (a2 , SCons .Action .ListAction ), f"a2 is { type ( a2 ) } "
363
363
assert a2 .varlist == (), a2 .varlist
364
364
assert isinstance (a2 .list [0 ], SCons .Action .CommandAction ), a2 .list [0 ]
365
365
assert a2 .list [0 ].cmd_list == "x" , a2 .list [0 ].cmd_list
@@ -372,7 +372,7 @@ def foo() -> None:
372
372
pass
373
373
374
374
a3 = SCons .Action .Action (["x" , foo , "z" ])
375
- assert isinstance (a3 , SCons .Action .ListAction ), a3
375
+ assert isinstance (a3 , SCons .Action .ListAction ), f"a3 is { type ( a3 ) } "
376
376
assert a3 .varlist == (), a3 .varlist
377
377
assert isinstance (a3 .list [0 ], SCons .Action .CommandAction ), a3 .list [0 ]
378
378
assert a3 .list [0 ].cmd_list == "x" , a3 .list [0 ].cmd_list
@@ -382,7 +382,7 @@ def foo() -> None:
382
382
assert a3 .list [2 ].cmd_list == "z" , a3 .list [2 ].cmd_list
383
383
384
384
a4 = SCons .Action .Action (["x" , "y" ], strfunction = foo )
385
- assert isinstance (a4 , SCons .Action .ListAction ), a4
385
+ assert isinstance (a4 , SCons .Action .ListAction ), f"a4 is { type ( a4 ) } "
386
386
assert a4 .varlist == (), a4 .varlist
387
387
assert isinstance (a4 .list [0 ], SCons .Action .CommandAction ), a4 .list [0 ]
388
388
assert a4 .list [0 ].cmd_list == "x" , a4 .list [0 ].cmd_list
@@ -392,7 +392,7 @@ def foo() -> None:
392
392
assert a4 .list [1 ].strfunction == foo , a4 .list [1 ].strfunction
393
393
394
394
a5 = SCons .Action .Action ("x\n y" , strfunction = foo )
395
- assert isinstance (a5 , SCons .Action .ListAction ), a5
395
+ assert isinstance (a5 , SCons .Action .ListAction ), f"a5 is { type ( a5 ) } "
396
396
assert a5 .varlist == (), a5 .varlist
397
397
assert isinstance (a5 .list [0 ], SCons .Action .CommandAction ), a5 .list [0 ]
398
398
assert a5 .list [0 ].cmd_list == "x" , a5 .list [0 ].cmd_list
@@ -401,6 +401,9 @@ def foo() -> None:
401
401
assert a5 .list [1 ].cmd_list == "y" , a5 .list [1 ].cmd_list
402
402
assert a5 .list [1 ].strfunction == foo , a5 .list [1 ].strfunction
403
403
404
+ a6 = SCons .Action .Action (["action with space" ])
405
+ assert isinstance (a6 , SCons .Action .CommandAction ), f"a6 is { type (a6 )} "
406
+
404
407
def test_CommandGeneratorAction (self ) -> None :
405
408
"""Test the Action factory's creation of CommandGeneratorAction objects."""
406
409
@@ -1544,6 +1547,7 @@ def LocalFunc() -> None:
1544
1547
(3 , 10 ): bytearray (b'0, 0, 0, 0,(),(),(d\x00 S\x00 ),(),()' ),
1545
1548
(3 , 11 ): bytearray (b'0, 0, 0, 0,(),(),(\x97 \x00 d\x00 S\x00 ),(),()' ),
1546
1549
(3 , 12 ): bytearray (b'0, 0, 0, 0,(),(),(\x97 \x00 y\x00 ),(),()' ),
1550
+ (3 , 13 ): bytearray (b'0, 0, 0, 0,(),(),(\x95 \x00 g\x00 ),(),()' ),
1547
1551
}
1548
1552
1549
1553
meth_matches = [
@@ -1725,6 +1729,7 @@ def LocalFunc() -> None:
1725
1729
(3 , 10 ): bytearray (b'0, 0, 0, 0,(),(),(d\x00 S\x00 ),(),()' ),
1726
1730
(3 , 11 ): bytearray (b'0, 0, 0, 0,(),(),(\x97 \x00 d\x00 S\x00 ),(),()' ),
1727
1731
(3 , 12 ): bytearray (b'0, 0, 0, 0,(),(),(\x97 \x00 y\x00 ),(),()' ),
1732
+ (3 , 13 ): bytearray (b'0, 0, 0, 0,(),(),(\x95 \x00 g\x00 ),(),()' ),
1728
1733
1729
1734
}
1730
1735
@@ -1737,6 +1742,7 @@ def LocalFunc() -> None:
1737
1742
(3 , 10 ): bytearray (b'1, 1, 0, 0,(),(),(d\x00 S\x00 ),(),()' ),
1738
1743
(3 , 11 ): bytearray (b'1, 1, 0, 0,(),(),(\x97 \x00 d\x00 S\x00 ),(),()' ),
1739
1744
(3 , 12 ): bytearray (b'1, 1, 0, 0,(),(),(\x97 \x00 y\x00 ),(),()' ),
1745
+ (3 , 13 ): bytearray (b'1, 1, 0, 0,(),(),(\x95 \x00 g\x00 ),(),()' ),
1740
1746
}
1741
1747
1742
1748
def factory (act , ** kw ):
@@ -1978,6 +1984,7 @@ def LocalFunc() -> None:
1978
1984
(3 , 10 ): bytearray (b'0, 0, 0, 0,(),(),(d\x00 S\x00 ),(),()' ),
1979
1985
(3 , 11 ): bytearray (b'0, 0, 0, 0,(),(),(\x97 \x00 d\x00 S\x00 ),(),()' ),
1980
1986
(3 , 12 ): bytearray (b'0, 0, 0, 0,(),(),(\x97 \x00 y\x00 ),(),()' ),
1987
+ (3 , 13 ): bytearray (b'0, 0, 0, 0,(),(),(\x95 \x00 g\x00 ),(),()' ),
1981
1988
}
1982
1989
1983
1990
meth_matches = [
@@ -2041,6 +2048,7 @@ def LocalFunc() -> None:
2041
2048
(3 , 10 ): b'd\x00 S\x00 ' ,
2042
2049
(3 , 11 ): b'\x97 \x00 d\x00 S\x00 ' ,
2043
2050
(3 , 12 ): b'\x97 \x00 y\x00 ' ,
2051
+ (3 , 13 ): b'\x95 \x00 g\x00 ' ,
2044
2052
}
2045
2053
2046
2054
with self .subTest ():
@@ -2247,6 +2255,7 @@ def func1(a, b, c):
2247
2255
),
2248
2256
(3 , 11 ): (bytearray (b'3, 3, 0, 0,(),(),(\x97 \x00 |\x00 S\x00 ),(),()' ),),
2249
2257
(3 , 12 ): (bytearray (b'3, 3, 0, 0,(),(),(\x97 \x00 |\x00 S\x00 ),(),()' ),),
2258
+ (3 , 13 ): (bytearray (b'3, 3, 0, 0,(),(),(\x95 \x00 U\x00 $\x00 ),(),()' ),),
2250
2259
}
2251
2260
2252
2261
c = SCons .Action ._function_contents (func1 )
@@ -2288,6 +2297,9 @@ def test_object_contents(self) -> None:
2288
2297
(3 , 12 ): bytearray (
2289
2298
b"{TestClass:__main__}[[[(<class \' object\' >, ()), [(<class \' __main__.TestClass\' >, (<class \' object\' >,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x97 \x00 d\x01 |\x00 _\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 d\x02 |\x00 _\x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 y\x00 ),(),(),2, 2, 0, 0,(),(),(\x97 \x00 y\x00 ),(),()}}{{{a=a,b=b}}}"
2290
2299
),
2300
+ (3 , 13 ): bytearray (
2301
+ b"{TestClass:__main__}[[[(<class \' object\' >, ()), [(<class \' __main__.TestClass\' >, (<class \' object\' >,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(\x95 \x00 S\x01 U\x00 l\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 S\x02 U\x00 l\x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 g\x00 ),(),(),2, 2, 0, 0,(),(),(\x95 \x00 g\x00 ),(),()}}{{{a=a,b=b}}}"
2302
+ ),
2291
2303
}
2292
2304
2293
2305
self .assertEqual (c , expected [sys .version_info [:2 ]])
@@ -2324,6 +2336,9 @@ def test_code_contents(self) -> None:
2324
2336
(3 , 12 ): bytearray (
2325
2337
b'0, 0, 0, 0,(Hello, World!),(print),(\x97 \x00 \x02 \x00 e\x00 d\x00 \xab \x01 \x00 \x00 \x00 \x00 \x00 \x00 \x01 \x00 y\x01 )'
2326
2338
),
2339
+ (3 , 13 ): bytearray (
2340
+ b'0, 0, 0, 0,(Hello, World!),(print),(\x95 \x00 \\ \x00 "\x00 S\x00 5\x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 g\x01 )'
2341
+ ),
2327
2342
}
2328
2343
2329
2344
self .assertEqual (c , expected [sys .version_info [:2 ]])
0 commit comments