| 153 | ) |
| 154 | |
| 155 | def test_func_references(self, tctx: Context): |
| 156 | nl = layer.NextLayer(tctx) |
| 157 | playbook = tutils.Playbook(nl) |
| 158 | |
| 159 | assert ( |
| 160 | playbook |
| 161 | >> events.DataReceived(tctx.client, b"foo") |
| 162 | << layer.NextLayerHook(nl) |
| 163 | ) |
| 164 | nl.layer = tutils.EchoLayer(tctx) |
| 165 | handle = nl.handle_event |
| 166 | |
| 167 | playbook >> tutils.reply() |
| 168 | playbook << commands.SendData(tctx.client, b"foo") |
| 169 | assert playbook |
| 170 | (sd,) = handle(events.DataReceived(tctx.client, b"bar")) |
| 171 | assert isinstance(sd, commands.SendData) |
| 172 | |
| 173 | def test_repr(self, tctx: Context): |
| 174 | nl = layer.NextLayer(tctx) |