Properly handle case where we receive an additional event while we are waiting for a reply from the proxy core.
(self, tctx: Context)
| 106 | ) |
| 107 | |
| 108 | def test_late_hook_reply(self, tctx: Context): |
| 109 | """ |
| 110 | Properly handle case where we receive an additional event while we are waiting for |
| 111 | a reply from the proxy core. |
| 112 | """ |
| 113 | nl = layer.NextLayer(tctx) |
| 114 | playbook = tutils.Playbook(nl) |
| 115 | |
| 116 | assert ( |
| 117 | playbook |
| 118 | >> events.DataReceived(tctx.client, b"foo") |
| 119 | << layer.NextLayerHook(nl) |
| 120 | >> events.DataReceived(tctx.client, b"bar") |
| 121 | ) |
| 122 | assert nl.data_client() == b"foo" # "bar" is paused. |
| 123 | nl.layer = tutils.EchoLayer(tctx) |
| 124 | |
| 125 | assert ( |
| 126 | playbook |
| 127 | >> tutils.reply(to=-2) |
| 128 | << commands.SendData(tctx.client, b"foo") |
| 129 | << commands.SendData(tctx.client, b"bar") |
| 130 | ) |
| 131 | |
| 132 | @pytest.mark.parametrize("layer_found", [True, False]) |
| 133 | def test_receive_close(self, tctx: Context, layer_found: bool): |
nothing calls this directly
no test coverage detected