MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_parse_spec

Function test_parse_spec

test/mitmproxy/utils/test_spec.py:6–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_parse_spec():
7 flow_filter, subject, replacement = parse_spec("/foo/bar/voing")
8 assert flow_filter.pattern == "foo"
9 assert subject == "bar"
10 assert replacement == "voing"
11
12 flow_filter, subject, replacement = parse_spec("/bar/voing")
13 assert flow_filter(1) is True
14 assert subject == "bar"
15 assert replacement == "voing"
16
17 with pytest.raises(ValueError, match="Invalid number of parameters"):
18 parse_spec("/")
19
20 with pytest.raises(ValueError, match="Invalid filter expression"):
21 parse_spec("/~b/one/two")

Callers

nothing calls this directly

Calls 1

parse_specFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…