How to use the fakeredis._server.BeforeAny function in fakeredis

To help you get started, we’ve selected a few fakeredis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesls / fakeredis / fakeredis / _server.py View on Github external
def sort_key(v):
                    byval = self._lookup_key(v, sortby)
                    # TODO: use locale.strxfrm when not storing? But then need
                    # to decode too.
                    if byval is None:
                        byval = BeforeAny()
                    return byval
github jamesls / fakeredis / fakeredis / _server.py View on Github external
def __eq__(self, other):
        return isinstance(other, BeforeAny)
github jamesls / fakeredis / fakeredis / _server.py View on Github external
def decode(cls, value):
        if value == b'-':
            return cls(BeforeAny(), True)
        elif value == b'+':
            return cls(AfterAny(), True)
        elif value[:1] == b'(':
            return cls(value[1:], True)
        elif value[:1] == b'[':
            return cls(value[1:], False)
        else:
            raise redis.ResponseError(INVALID_MIN_MAX_STR_MSG)