MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_settings

Function test_settings

test/mitmproxy/addons/test_view.py:637–656  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

635
636
637def test_settings():
638 v = view.View()
639 f = tft()
640
641 with pytest.raises(KeyError):
642 v.settings[f]
643 v.add([f])
644 v.settings[f]["foo"] = "bar"
645 assert v.settings[f]["foo"] == "bar"
646 assert len(list(v.settings)) == 1
647 v.remove([f])
648 with pytest.raises(KeyError):
649 v.settings[f]
650 assert not v.settings.keys()
651
652 v.add([f])
653 v.settings[f]["foo"] = "bar"
654 assert v.settings.keys()
655 v.clear()
656 assert not v.settings.keys()
657
658
659def test_properties():

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
removeMethod · 0.95
clearMethod · 0.95
tftFunction · 0.85
keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…