(self, tctx: Context)
| 80 | |
| 81 | class TestNextLayer: |
| 82 | def test_simple(self, tctx: Context): |
| 83 | nl = layer.NextLayer(tctx, ask_on_start=True) |
| 84 | nl.debug = " " |
| 85 | playbook = tutils.Playbook(nl, hooks=True) |
| 86 | |
| 87 | assert ( |
| 88 | playbook |
| 89 | << layer.NextLayerHook(nl) |
| 90 | >> tutils.reply() |
| 91 | >> events.DataReceived(tctx.client, b"foo") |
| 92 | << layer.NextLayerHook(nl) |
| 93 | >> tutils.reply() |
| 94 | >> events.DataReceived(tctx.client, b"bar") |
| 95 | << layer.NextLayerHook(nl) |
| 96 | ) |
| 97 | assert nl.data_client() == b"foobar" |
| 98 | assert nl.data_server() == b"" |
| 99 | |
| 100 | nl.layer = tutils.EchoLayer(tctx) |
| 101 | assert ( |
| 102 | playbook |
| 103 | >> tutils.reply() |
| 104 | << commands.SendData(tctx.client, b"foo") |
| 105 | << commands.SendData(tctx.client, b"bar") |
| 106 | ) |
| 107 | |
| 108 | def test_late_hook_reply(self, tctx: Context): |
| 109 | """ |
no test coverage detected