Skip to content

Commit

Permalink
Use current nodes in test
Browse files Browse the repository at this point in the history
  • Loading branch information
liamhuber committed May 15, 2023
1 parent f1d81fb commit c466ba3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def tearDown(self) -> None:

def test_multiple_scripts(self):
gui = GUI('foo')
gui.workflows.flow_canvas.add_node(0, 0, gui.nodes_dictionary['built_in']['val'])
gui.workflows.flow_canvas.add_node(0, 0, gui.nodes_dictionary['array']['Linspace'])
gui.create_script()
gui.workflows.flow_canvas.add_node(1, 1, gui.nodes_dictionary['built_in']['result'])
gui.workflows.flow_canvas.add_node(1, 1, gui.nodes_dictionary['array']['Select'])
canonical_file_name = f"{gui.session_title}.json"
gui.save(canonical_file_name)
new_gui = GUI('something_random')
Expand Down Expand Up @@ -51,8 +51,8 @@ def test_saving_and_loading(self):

self.assertEqual(0, len(flow.nodes), msg="Fresh GUI shouldn't have any nodes yet.")

canvas.add_node(0, 0, gui.nodes_dictionary['built_in']['val']) # Need to create with canvas instead of flow
canvas.add_node(1, 0, gui.nodes_dictionary['built_in']['result']) # because serialization includes xy location
canvas.add_node(0, 0, gui.nodes_dictionary['array']['Linspace']) # Need to create with canvas instead of flow
canvas.add_node(1, 0, gui.nodes_dictionary['array']['Select']) # because serialization includes xy location
n1, n2 = flow.nodes
flow.connect_nodes(n1.outputs[0], n2.inputs[0])

Expand Down

0 comments on commit c466ba3

Please sign in to comment.