Skip to content

Commit

Permalink
Refactor: slide
Browse files Browse the repository at this point in the history
Start by testing things that are forbidden, and move to successful stuff
  • Loading branch information
liamhuber committed Jun 22, 2023
1 parent 77931c8 commit cbc8fbc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/unit/workflow/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ def test_assignment(self):
with self.assertRaises(TypeError):
self.input.foo = "not an input channel"

with self.assertRaises(TypeError):
# Right label, and a channel, but wrong type of channel
self.input.b = self.post_facto_output

with self.subTest("Successful channel assignment"):
self.output.b = self.post_facto_output

with self.subTest("Can assign to a key that is not the label"):
label_before_assignment = self.post_facto_output.label
self.output.not_this_channels_name = self.post_facto_output
Expand All @@ -55,13 +62,6 @@ def test_assignment(self):
"collections"
)

with self.assertRaises(TypeError):
# Right label, and a channel, but wrong type of channel
self.input.b = self.post_facto_output

with self.subTest("Successful channel assignment"):
self.output.b = self.post_facto_output

def test_connection(self):
self.input.x = self.input.y
self.assertEqual(
Expand Down

0 comments on commit cbc8fbc

Please sign in to comment.