MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / test_join

Function test_join

test/mitmproxy/tools/console/test_keymap.py:42–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41
42def test_join():
43 with taddons.context() as tctx:
44 km = keymap.Keymap(tctx.master)
45 km.add("key", "str", ["options"], "help1")
46 km.add("key", "str", ["commands"])
47
48 assert len(km.bindings) == 1
49 assert len(km.bindings[0].contexts) == 2
50 assert km.bindings[0].help == "help1"
51 km.add("key", "str", ["commands"], "help2")
52 assert len(km.bindings) == 1
53 assert len(km.bindings[0].contexts) == 2
54 assert km.bindings[0].help == "help2"
55
56 assert km.get("commands", "key")
57 km.unbind(km.bindings[0])
58 assert len(km.bindings) == 0
59 assert not km.get("commands", "key")
60
61
62def test_remove():

Callers

nothing calls this directly

Calls 4

addMethod · 0.95
getMethod · 0.95
unbindMethod · 0.95
contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…