MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_toggler

Function test_toggler

test/mitmproxy/test_optmanager.py:134–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132
133
134def test_toggler():
135 o = TO()
136 f = o.toggler("bool")
137 assert o.bool is False
138 f()
139 assert o.bool is True
140 f()
141 assert o.bool is False
142 with pytest.raises(Exception, match="No such option"):
143 o.toggler("nonexistent")
144
145 with pytest.raises(Exception, match="boolean options"):
146 o.toggler("one")
147
148
149class Rec:

Callers

nothing calls this directly

Calls 3

togglerMethod · 0.80
TOClass · 0.70
fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…