summaryrefslogtreecommitdiff
path: root/tests/scripts/python
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-10-24 23:33:52 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-10-24 23:33:52 +0200
commit0fd1913ae8080a68fb1b0fcc3dd24c06acb119c7 (patch)
tree55441d15f6a1bde8004991702530c699e15ed12b /tests/scripts/python
parent1e6db7b489127e3a87601b8d1f8d66c7b1c5787a (diff)
downloadweechat-0fd1913ae8080a68fb1b0fcc3dd24c06acb119c7.zip
tests: add tests on key_bind and key_unbind scripting API functions
Diffstat (limited to 'tests/scripts/python')
-rw-r--r--tests/scripts/python/testapi.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/scripts/python/testapi.py b/tests/scripts/python/testapi.py
index e5b392d1f..f295050a3 100644
--- a/tests/scripts/python/testapi.py
+++ b/tests/scripts/python/testapi.py
@@ -120,6 +120,21 @@ def test_lists():
weechat.list_free(ptr_list)
+def test_key():
+ """Test key functions."""
+ check(
+ weechat.key_bind(
+ 'mouse',
+ {
+ '@chat(plugin.test):button1': 'hsignal:test_mouse',
+ '@chat(plugin.test):wheelup': '/mycommand up',
+ '@chat(plugin.test):wheeldown': '/mycommand down',
+ '__quiet': '',
+ }
+ ) == 3)
+ check(weechat.key_unbind('mouse', 'quiet:area:chat(plugin.test)') == 3)
+
+
def cmd_test_cb(data, buf, args):
"""Run all the tests."""
weechat.prnt('', '>>>')
@@ -129,6 +144,7 @@ def cmd_test_cb(data, buf, args):
test_plugins()
test_strings()
test_lists()
+ test_key()
weechat.prnt('', ' > TESTS END')
return weechat.WEECHAT_RC_OK