File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -701,9 +701,30 @@ def test_safe_builtins_remain_allowlisted(self) -> None:
701701 result = self ._scan_bytes (self ._craft_global_reduce_pickle ("builtins" , safe_builtin ))
702702
703703 assert result .success
704+ assert not result .has_warnings
704705 assert not result .has_errors , (
705706 f"Expected builtins.{ safe_builtin } to remain non-failing, got: { [i .message for i in result .issues ]} "
706707 )
708+ passed_global_checks = [
709+ check
710+ for check in result .checks
711+ if check .name == "Global Module Reference Check" and check .status == CheckStatus .PASSED
712+ ]
713+ assert any (f"builtins.{ safe_builtin } " in check .message for check in passed_global_checks ), (
714+ f"Expected passed Global Module Reference Check for builtins.{ safe_builtin } , "
715+ f"got: { [check .message for check in passed_global_checks ]} "
716+ )
717+ passed_reduce_checks = [
718+ check
719+ for check in result .checks
720+ if check .name == "REDUCE Opcode Safety Check" and check .status == CheckStatus .PASSED
721+ ]
722+ assert any (
723+ check .details .get ("associated_global" ) == f"builtins.{ safe_builtin } " for check in passed_reduce_checks
724+ ), (
725+ f"Expected passed REDUCE check for builtins.{ safe_builtin } , "
726+ f"got: { [check .details for check in passed_reduce_checks ]} "
727+ )
707728
708729 def test_dangerous_builtins_still_fail (self ) -> None :
709730 """Dangerous builtins must continue to fail after allowlist tightening."""
You can’t perform that action at this time.
0 commit comments