MCPcopy Index your code
hub / github.com/bhowiebkr/PyFlowGraph / setUp

Method setUp

tests/test_selection_operations.py:115–142  ·  view source on GitHub ↗

Set up test fixtures with real instances.

(self)

Source from the content-addressed store, hash-verified

113 cls.app = QApplication.instance()
114
115 def setUp(self):
116 """Set up test fixtures with real instances."""
117 # Create a real NodeGraph for testing
118 self.graph = NodeGraph()
119
120 # Create real nodes for testing
121 self.node1 = Node("Test Node")
122 self.node2 = Node("Another Node")
123
124 # Add nodes to graph
125 self.graph.addItem(self.node1)
126 self.graph.addItem(self.node2)
127
128 # Set up node code to ensure they have pins
129 self.node1.set_code("def test():\n return 42")
130 self.node2.set_code("def process(value):\n return value * 2")
131
132 # Create connections between nodes if pins exist
133 self.connection1 = None
134 self.connection2 = None
135
136 if self.node1.output_pins and self.node2.input_pins:
137 self.connection1 = Connection(
138 self.node1.output_pins[0],
139 self.node2.input_pins[0],
140 self.graph
141 )
142 self.graph.addItem(self.connection1)
143
144 def test_delete_single_node_description(self):
145 """Test description generation for single node deletion."""

Callers

nothing calls this directly

Calls 4

NodeGraphClass · 0.90
NodeClass · 0.90
ConnectionClass · 0.90
set_codeMethod · 0.80

Tested by

no test coverage detected