| 155 | |
| 156 | @pytest.mark.parametrize("swap", [False, True]) |
| 157 | def test_command_multiple_replies(tplaybook, swap): |
| 158 | a = tutils.Placeholder(int) |
| 159 | b = tutils.Placeholder(int) |
| 160 | |
| 161 | command1 = TCommand(a) |
| 162 | command2 = TCommand(b) |
| 163 | |
| 164 | tplaybook >> TEvent([1]) |
| 165 | tplaybook << command1 |
| 166 | tplaybook >> TEvent([2]) |
| 167 | tplaybook << command2 |
| 168 | |
| 169 | if swap: |
| 170 | tplaybook >> tutils.reply(to=command1) |
| 171 | tplaybook >> tutils.reply(to=command2) |
| 172 | else: |
| 173 | tplaybook >> tutils.reply(to=command2) |
| 174 | tplaybook >> tutils.reply(to=command1) |
| 175 | assert tplaybook |
| 176 | assert a() == 1 |
| 177 | assert b() == 2 |