From 0fd1913ae8080a68fb1b0fcc3dd24c06acb119c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 24 Oct 2017 23:33:52 +0200 Subject: [PATCH] tests: add tests on key_bind and key_unbind scripting API functions --- tests/scripts/python/testapi.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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