Perform a server capability check

def capabilityCheck(self, optional=None, required=None):
        """ Perform a server capability check """
        res = self.query(
            "version", {"optional": optional or [], "required": required or []}
        )

        if not self._hasprop(res, "capabilities"):
            # Server doesn't support capabilities, so we need to
            # synthesize the results based on the version
            capabilities.synthesize(res, optional)
            if "error" in res:
                raise CommandError(res["error"])

        return res