(self)
| 62 | assert (f.response.content == b"bar") ^ take |
| 63 | |
| 64 | def test_order(self): |
| 65 | mb = modifybody.ModifyBody() |
| 66 | with taddons.context(mb) as tctx: |
| 67 | tctx.configure( |
| 68 | mb, |
| 69 | modify_body=[ |
| 70 | "/foo/bar", |
| 71 | "/bar/baz", |
| 72 | "/foo/oh noes!", |
| 73 | "/bar/oh noes!", |
| 74 | ], |
| 75 | ) |
| 76 | f = tflow.tflow() |
| 77 | f.request.content = b"foo" |
| 78 | mb.request(f) |
| 79 | assert f.request.content == b"baz" |
| 80 | |
| 81 | def test_backslash_in_replacement(self): |
| 82 | mb = modifybody.ModifyBody() |