From 75567f86ca66f7aa598ccb6c093af8224e5e8753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 25 Mar 2025 05:01:34 +0100 Subject: [PATCH] Make response handlers global by default Instead of requiring each class inheriting from ResponseHandler to define its match() method, make the latter non-abstract and default to returning True for all queries. This will reduce the amount of boilerplate code in custom servers. --- bin/tests/system/isctest/asyncserver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/isctest/asyncserver.py b/bin/tests/system/isctest/asyncserver.py index b4270fa899..996db22893 100644 --- a/bin/tests/system/isctest/asyncserver.py +++ b/bin/tests/system/isctest/asyncserver.py @@ -360,10 +360,13 @@ class ResponseHandler(abc.ABC): method. """ - @abc.abstractmethod + # pylint: disable=unused-argument def match(self, qctx: QueryContext) -> bool: """ - Matching logic - query is handled when it returns True. + Matching logic - the first handler whose `match()` method returns True + is used for handling the query. + + The default for each handler is to handle all queries. """ return True