Mock command for testing.
| 25 | QT_AVAILABLE = True |
| 26 | |
| 27 | class MockCommand(CommandBase): |
| 28 | """Mock command for testing.""" |
| 29 | |
| 30 | def __init__(self, description: str): |
| 31 | super().__init__(description) |
| 32 | self.timestamp = datetime.now() |
| 33 | self.execute_called = False |
| 34 | self.undo_called = False |
| 35 | |
| 36 | def execute(self) -> bool: |
| 37 | self.execute_called = True |
| 38 | return True |
| 39 | |
| 40 | def undo(self) -> bool: |
| 41 | self.undo_called = True |
| 42 | return True |
| 43 | |
| 44 | except ImportError: |
| 45 | QT_AVAILABLE = False |
no outgoing calls