Skip to content

Commit

Permalink
fix:tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Oct 21, 2023
1 parent 492f61c commit 2f98e9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fakeredis/commands_mixins/server_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any, List, Optional, Dict

from fakeredis import _msgs as msgs
from fakeredis._commands import command, DbIndex, SUPPORTED_COMMANDS
from fakeredis._commands import command, DbIndex
from fakeredis._helpers import OK, SimpleError, casematch, BGSAVE_STARTED, Database

_COMMAND_INFO: Dict[bytes, List[Any]] = None
Expand Down Expand Up @@ -32,11 +32,11 @@ class ServerCommandsMixin:
_db: Database

@staticmethod
def _get_command_info(cmd: str) -> Optional[List[Any]]:
def _get_command_info(cmd: bytes) -> Optional[List[Any]]:
_load_command_info()
if cmd not in SUPPORTED_COMMANDS or cmd.encode() not in _COMMAND_INFO:
if cmd not in _COMMAND_INFO:
return None
return _COMMAND_INFO[cmd.encode()]
return _COMMAND_INFO.get(cmd, None)

@command((), (bytes,), flags=msgs.FLAG_NO_SCRIPT)
def bgsave(self, *args):
Expand Down Expand Up @@ -100,7 +100,7 @@ def command_count(self):
return len(_COMMAND_INFO)

@command(name="COMMAND", fixed=(), repeat=())
def command(self):
def command_(self):
_load_command_info()
res = [self._get_command_info(cmd.decode()) for cmd in _COMMAND_INFO]
res = [self._get_command_info(cmd) for cmd in _COMMAND_INFO]
return res

0 comments on commit 2f98e9c

Please sign in to comment.