| 40 | |
| 41 | |
| 42 | def 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 | |
| 62 | def test_remove(): |