()
| 8 | |
| 9 | |
| 10 | def test_parse_modify_spec(): |
| 11 | spec = parse_modify_spec("/foo/bar/voing", True) |
| 12 | assert spec.matches.pattern == "foo" |
| 13 | assert spec.subject == b"bar" |
| 14 | assert spec.read_replacement() == b"voing" |
| 15 | |
| 16 | spec = parse_modify_spec("/foo/bar/vo/ing/", False) |
| 17 | assert spec.matches.pattern == "foo" |
| 18 | assert spec.subject == b"bar" |
| 19 | assert spec.read_replacement() == b"vo/ing/" |
| 20 | |
| 21 | spec = parse_modify_spec("/bar/voing", False) |
| 22 | assert spec.matches(tflow.tflow()) |
| 23 | assert spec.subject == b"bar" |
| 24 | assert spec.read_replacement() == b"voing" |
| 25 | |
| 26 | with pytest.raises(ValueError, match="Invalid regular expression"): |
| 27 | parse_modify_spec("/[/two", True) |
| 28 | |
| 29 | |
| 30 | class TestModifyHeaders: |
nothing calls this directly
no test coverage detected
searching dependent graphs…