Skip to content

Commit bd4279d

Browse files
committed
adding variation of test where user silences all actions passed in to Either
1 parent 63ba573 commit bd4279d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/test_actions.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,22 @@ def test_multi_action_describe_with_silently(self) -> None:
12271227

12281228
assert t.describe() == "Either doThing or performFoo"
12291229

1230+
def test_multi_action_describe_with_multiple_silently(self) -> None:
1231+
mock_action1 = FakeAction()
1232+
mock_action1.describe.return_value = "DoThing!"
1233+
mock_action2 = FakeAction()
1234+
mock_action2.describe.return_value = "DoStuff!"
1235+
mock_action3 = FakeAction()
1236+
mock_action3.describe.return_value = "PerformFoo."
1237+
mock_action4 = FakeAction()
1238+
mock_action4.describe.return_value = "PerformBar."
1239+
1240+
t = Either(Silently(mock_action1), Silently(mock_action2)).or_(
1241+
Silently(mock_action3), Silently(mock_action4)
1242+
)
1243+
1244+
assert t.describe() == "Either or "
1245+
12301246
def test_first_action_passes(self, Tester: Actor, mocker: MockerFixture) -> None:
12311247
mock_clear = mocker.spy(the_narrator, "clear_backup")
12321248
mock_flush = mocker.spy(the_narrator, "flush_backup")

0 commit comments

Comments
 (0)