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

Method test_move_node_command

tests/test_command_system.py:289–305  ·  view source on GitHub ↗

Test node movement command.

(self)

Source from the content-addressed store, hash-verified

287 self.assertEqual(len(self.node_graph.nodes), initial_count + 1)
288
289 def test_move_node_command(self):
290 """Test node movement command."""
291 node = Node("TestNode")
292 old_pos = QPointF(50, 50)
293 new_pos = QPointF(150, 150)
294 node.setPos(old_pos)
295
296 cmd = MoveNodeCommand(self.node_graph, node, old_pos, new_pos)
297 success = cmd.execute()
298
299 self.assertTrue(success)
300 self.assertEqual(node.pos(), new_pos)
301
302 # Test undo
303 success = cmd.undo()
304 self.assertTrue(success)
305 self.assertEqual(node.pos(), old_pos)
306
307 def test_move_command_merging(self):
308 """Test that move commands can be merged."""

Callers

nothing calls this directly

Calls 4

executeMethod · 0.95
undoMethod · 0.95
NodeClass · 0.90
MoveNodeCommandClass · 0.90

Tested by

no test coverage detected