MCPcopy
hub / github.com/trailofbits/algo / MockModule

Class MockModule

tests/unit/test_wireguard_key_generation.py:78–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77 # Mock the AnsibleModule for testing
78 class MockModule:
79 def __init__(self, params):
80 self.params = params
81 self.result = {}
82
83 def fail_json(self, **kwargs):
84 raise Exception(f"Module failed: {kwargs}")
85
86 def exit_json(self, **kwargs):
87 self.result = kwargs
88
89 with tempfile.NamedTemporaryFile(suffix=".pub", delete=False) as temp_pub:
90 public_key_path = temp_pub.name

Calls

no outgoing calls