CommandReplies can use relative offsets to point to the matching command.
(tplaybook)
| 107 | |
| 108 | |
| 109 | def test_command_reply(tplaybook): |
| 110 | """CommandReplies can use relative offsets to point to the matching command.""" |
| 111 | tplaybook >> TEvent() |
| 112 | tplaybook << TCommand() |
| 113 | tplaybook >> tutils.reply() |
| 114 | assert tplaybook |
| 115 | assert tplaybook.actual[1] == tplaybook.actual[2].command |
| 116 | |
| 117 | tplaybook >> TEvent((42,)) |
| 118 | tplaybook << TCommand(42) |
| 119 | tplaybook >> tutils.reply(to=TCommand) |
| 120 | assert tplaybook |
| 121 | assert tplaybook.actual[4] == tplaybook.actual[5].command |
| 122 | |
| 123 | |
| 124 | def test_default_playbook(tctx): |