From fbf9f0166d732defc1ea474f3e0a5960aaf57e99 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 29 Aug 2020 16:42:19 +0200 Subject: [PATCH] Autocomplete: Fix name of response tag. --- plugins/Autocomplete/plugin.py | 6 +++--- plugins/Autocomplete/test.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/Autocomplete/plugin.py b/plugins/Autocomplete/plugin.py index d2325c4b3..041212252 100644 --- a/plugins/Autocomplete/plugin.py +++ b/plugins/Autocomplete/plugin.py @@ -42,11 +42,11 @@ except ImportError: REQUEST_TAG = "+draft/autocomplete-request" -RESPONSE_TAG = "+draft/autocomplete" +RESPONSE_TAG = "+draft/autocomplete-response" def _getAutocompleteResponse(irc, msg, payload): - """Returns the value of the +draft/autocomplete tag for the given + """Returns the value of the +draft/autocomplete-response tag for the given +draft/autocomplete-request payload.""" tokens = callbacks.tokenize(payload, channel=msg.channel, network=irc.network) normalized_payload = " ".join(tokens) @@ -130,7 +130,7 @@ class Autocomplete(callbacks.Plugin): ircmsgs.IrcMsg( server_tags={ "+draft/reply": msgid, - "+draft/autocomplete": autocomplete_response, + RESPONSE_TAG: autocomplete_response, }, command="TAGMSG", args=[target], diff --git a/plugins/Autocomplete/test.py b/plugins/Autocomplete/test.py index 0b3d29ca9..c738c0e37 100644 --- a/plugins/Autocomplete/test.py +++ b/plugins/Autocomplete/test.py @@ -55,7 +55,7 @@ class AutocompleteTestCase(PluginTestCase): ircmsgs.IrcMsg( server_tags={ "+draft/reply": "1234", - "+draft/autocomplete": expectedResponse, + "+draft/autocomplete-response": expectedResponse, }, command="TAGMSG", args=["foo"], @@ -103,12 +103,13 @@ class AutocompleteChannelTestCase(ChannelPluginTestCase): ircmsgs.IrcMsg( server_tags={ "+draft/reply": "1234", - "+draft/autocomplete": expectedResponse, + "+draft/autocomplete-response": expectedResponse, }, command="TAGMSG", args=[self.channel], ), ) + def testResponse(self): with conf.supybot.protocols.irc.experimentalExtensions.context(True): with conf.supybot.plugins.Autocomplete.enabled.context(True):