def METHOD_NAME(self, request, expected=None, exitcode=None):
    """Execute a query and check expected result.
    :param request: query string
    :param expected: result string
    :param exitcode: exitcode
    """
    r = self.context.node.query(request)
    if expected is not None:
        with Then(f"output should match the expected", description=f"{expected}"):
            assert r.output == expected, error()
    elif exitcode is not None:
        with Then(f"output exitcode should match expected", description=f"{exitcode}"):
            assert r.exitcode == exitcode, error()