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

Method test_command_redo

tests/test_group_system.py:336–360  ·  view source on GitHub ↗

Test successful command redo.

(self, mock_get_group_class)

Source from the content-addressed store, hash-verified

334
335 @patch.object(CreateGroupCommand, '_get_group_class')
336 def test_command_redo(self, mock_get_group_class):
337 """Test successful command redo."""
338 # Setup, execute, and undo first
339 mock_group_class = Mock()
340 mock_group = Mock()
341 mock_group.name = "Test Group"
342 mock_group.member_node_uuids = ["uuid1", "uuid2"]
343 mock_group.scene.return_value = self.mock_scene
344 mock_group.calculate_bounds_from_members = Mock()
345 mock_group_class.return_value = mock_group
346 mock_get_group_class.return_value = mock_group_class
347
348 command = CreateGroupCommand(self.mock_scene, self.group_properties)
349 command.execute()
350 command.undo()
351
352 # Reset mock call counts
353 self.mock_scene.addItem.reset_mock()
354
355 # Test redo
356 result = command.redo()
357
358 self.assertTrue(result)
359 self.mock_scene.addItem.assert_called_with(mock_group)
360 self.assertIn(mock_group, self.mock_scene.groups)
361
362 def test_command_memory_usage(self):
363 """Test memory usage estimation."""

Callers

nothing calls this directly

Calls 4

executeMethod · 0.95
undoMethod · 0.95
redoMethod · 0.95
CreateGroupCommandClass · 0.90

Tested by

no test coverage detected