MCPcopy Create free account
hub / github.com/bhowiebkr/PyFlowGraph / MockCommand

Class MockCommand

tests/test_command_system.py:29–44  ·  view source on GitHub ↗

Mock command for testing base functionality.

Source from the content-addressed store, hash-verified

27
28
29class MockCommand(CommandBase):
30 """Mock command for testing base functionality."""
31
32 def __init__(self, description="Mock Command", should_fail=False):
33 super().__init__(description)
34 self.should_fail = should_fail
35 self.execute_count = 0
36 self.undo_count = 0
37
38 def execute(self):
39 self.execute_count += 1
40 return not self.should_fail
41
42 def undo(self):
43 self.undo_count += 1
44 return not self.should_fail
45
46
47class TestCommandBase(unittest.TestCase):

Calls

no outgoing calls