Skip to content

Commit

Permalink
Fix connection tests
Browse files Browse the repository at this point in the history
They weren't running because of the typo where they had the same name as the other test suite, and they got out of date.
  • Loading branch information
liamhuber committed Nov 28, 2023
1 parent 31868ee commit c0f929f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/unit/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sys import version_info

from pyiron_workflow.channels import (
InputData, InputSignal, OutputData, OutputSignal
InputData, InputSignal, OutputData, OutputSignal, ChannelConnectionError
)
from pyiron_workflow.io import Inputs, Outputs, Signals

Expand Down Expand Up @@ -65,11 +65,15 @@ def test_assignment(self):
)

def test_connection(self):
self.input.x = self.input.y
with self.assertRaises(
ChannelConnectionError,
msg="Shouldn't be allowed to connect two inputs"
):
self.input.x = self.input.y
self.assertEqual(
0,
len(self.input.x.connections),
msg="Shouldn't be allowed to connect two inputs, but only passes warning"
msg="Sanity check that the above error-raising connection never got made"
)

self.input.x = self.output.a
Expand All @@ -79,8 +83,8 @@ def test_connection(self):
msg="Should be able to create connections by assignment"
)

self.input.x = 7
self.assertEqual(self.input.x.value, 7)
self.input.x = 7.
self.assertEqual(self.input.x.value, 7.)

self.input.y = self.output.a
disconnected = self.input.disconnect()
Expand Down

0 comments on commit c0f929f

Please sign in to comment.