Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_list_or_string():
config.raw = False
assert renders.render_string_or_int(b"10.1") == '"10.1"'
assert renders.render_string_or_int(3) == FormattedText(
[("class:type", "(integer) "), ("", "3")]
)
def reder_funcname_mapping(self):
mapping = {}
for func_name, func in renders.__dict__.items():
if callable(func):
mapping[func_name] = func
return mapping
def render_response(self, response, completer, command_name, **options):
"Parses a response from the Redis server"
logger.info(f"[Redis-Server] Response: {response}")
# if in transaction, use queue render first
if config.transaction:
callback = renders.render_transaction_queue
rendered = callback(response, completer)
else:
rendered = self.render_command_result(command_name, response, completer)
return rendered