(tctx)
| 177 | |
| 178 | |
| 179 | def test_regular_hook_err(tctx): |
| 180 | f = Placeholder(DNSFlow) |
| 181 | |
| 182 | req = tdnsreq() |
| 183 | |
| 184 | def err(flow: DNSFlow): |
| 185 | flow.error = terr() |
| 186 | |
| 187 | assert ( |
| 188 | Playbook(dns.DNSLayer(tctx)) |
| 189 | >> DataReceived( |
| 190 | tctx.client, dns.pack_message(req, tctx.client.transport_protocol) |
| 191 | ) |
| 192 | << dns.DnsRequestHook(f) |
| 193 | >> reply(side_effect=err) |
| 194 | << dns.DnsErrorHook(f) |
| 195 | >> reply() |
| 196 | << SendData( |
| 197 | tctx.client, |
| 198 | dns.pack_message( |
| 199 | req.fail(response_codes.SERVFAIL), tctx.client.transport_protocol |
| 200 | ), |
| 201 | ) |
| 202 | >> ConnectionClosed(tctx.client) |
| 203 | << None |
| 204 | ) |
| 205 | assert f().error |
| 206 | assert not f().live |
| 207 | |
| 208 | |
| 209 | @pytest.mark.parametrize("transport_protocol", ["tcp", "udp"]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…