GRM-24: feat: bandit integration (#1)
Co-authored-by: Emil Simeonov <emil@theliberatededge.org> Reviewed-on: #1
This commit is contained in:
@@ -146,6 +146,9 @@ def test_main_module_block() -> None:
|
||||
source = source.replace('if __name__ == "__main__":\n main()\n', "")
|
||||
namespace = dict(vcm.__dict__)
|
||||
exec(compile(source, vcm.__file__, "exec"), namespace)
|
||||
# exec() redefines get_branch() from source, overwriting the mock.
|
||||
# Restore the patched mock so main() uses it.
|
||||
namespace["get_branch"] = vcm.get_branch
|
||||
namespace["main"]([msg_path], standalone_mode=False)
|
||||
|
||||
os.unlink(msg_path)
|
||||
|
||||
Reference in New Issue
Block a user