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

Method test_delete_node_undo

tests/test_command_system.py:272–287  ·  view source on GitHub ↗

Test undoing node deletion.

(self)

Source from the content-addressed store, hash-verified

270 self.assertNotIn(node, self.node_graph.nodes)
271
272 def test_delete_node_undo(self):
273 """Test undoing node deletion."""
274 # Create and delete a node
275 node = Node("TestNode")
276 node.setPos(self.test_position)
277 self.node_graph.addItem(node)
278 self.node_graph.nodes.append(node)
279
280 cmd = DeleteNodeCommand(self.node_graph, node)
281 cmd.execute()
282 initial_count = len(self.node_graph.nodes)
283
284 success = cmd.undo()
285
286 self.assertTrue(success)
287 self.assertEqual(len(self.node_graph.nodes), initial_count + 1)
288
289 def test_move_node_command(self):
290 """Test node movement command."""

Callers

nothing calls this directly

Calls 4

executeMethod · 0.95
undoMethod · 0.95
NodeClass · 0.90
DeleteNodeCommandClass · 0.90

Tested by

no test coverage detected