diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-08-01 22:18:38 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-08-01 22:18:38 +0200 |
commit | bcb8647aa47ae2213bedbdd3506d5af3a7c60c10 (patch) | |
tree | f21ee78d4c8c344c3d4155b3e31e1bca1d5d8bf2 /tests/scripts/python | |
parent | b1404b02777c58d5e104082f349dff201bd12ef8 (diff) | |
download | weechat-bcb8647aa47ae2213bedbdd3506d5af3a7c60c10.zip |
scripts: fix issue with long interval in function hook_timer
Affected plugins: python, ruby, lua, tcl, guile, javascript, php.
Diffstat (limited to 'tests/scripts/python')
-rw-r--r-- | tests/scripts/python/testapi.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/scripts/python/testapi.py b/tests/scripts/python/testapi.py index c4630981e..62dd922f6 100644 --- a/tests/scripts/python/testapi.py +++ b/tests/scripts/python/testapi.py @@ -219,6 +219,11 @@ def command_run_cb(data, buf, command): return weechat.WEECHAT_RC_OK +def timer_cb(data, remaining_calls): + """Timer callback.""" + return weechat.WEECHAT_RC_OK + + def test_hooks(): """Test function hook_command.""" # hook_completion / hook_completion_args / and hook_command @@ -237,6 +242,15 @@ def test_hooks(): weechat.unhook(hook_cmd_run) weechat.unhook(hook_cmd) weechat.unhook(hook_cmplt) + # hook_timer + hook_timer = weechat.hook_timer(5000111000, 0, 1, + 'timer_cb', 'timer_cb_data') + ptr_infolist = weechat.infolist_get('hook', hook_timer, '') + check(ptr_infolist != '') + check(weechat.infolist_next(ptr_infolist) == 1) + check(weechat.infolist_string(ptr_infolist, 'interval') == '5000111000') + weechat.infolist_free(ptr_infolist) + weechat.unhook(hook_timer) def test_command(): |