()
| 16 | |
| 17 | |
| 18 | def test_configure(): |
| 19 | d = dumper.Dumper() |
| 20 | with taddons.context(d) as ctx: |
| 21 | ctx.configure(d, dumper_filter="~b foo") |
| 22 | assert d.filter |
| 23 | |
| 24 | f = tflow.tflow(resp=True) |
| 25 | assert not d.match(f) |
| 26 | f.response.content = b"foo" |
| 27 | assert d.match(f) |
| 28 | |
| 29 | ctx.configure(d, dumper_filter=None) |
| 30 | assert not d.filter |
| 31 | with pytest.raises(exceptions.OptionsError): |
| 32 | ctx.configure(d, dumper_filter="~~") |
| 33 | assert not d.filter |
| 34 | |
| 35 | |
| 36 | def test_simple(): |