How to use the iredis.output.output_bytes function in iredis

To help you get started, we’ve selected a few iredis 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 laixintao / iredis / tests / test_output_function.py View on Github external
def test_output_bytes():
    assert output.output_bytes(b"hello world") == r"hello world"
    assert output.output_bytes(b'hello"world') == r"hello\"world"
    assert output.output_bytes(b"hello'world") == r"hello'world"

    assert output.output_bytes(b'"hello\\world"') == '\\"hello\\\\world\\"'

    assert output.output_bytes(b"'\"") == "'\\\""
    assert output.output_bytes("你好".encode()) == r"\xe4\xbd\xa0\xe5\xa5\xbd"
github laixintao / iredis / tests / test_output_function.py View on Github external
def test_output_bytes():
    assert output.output_bytes(b"hello world") == r"hello world"
    assert output.output_bytes(b'hello"world') == r"hello\"world"
    assert output.output_bytes(b"hello'world") == r"hello'world"

    assert output.output_bytes(b'"hello\\world"') == '\\"hello\\\\world\\"'

    assert output.output_bytes(b"'\"") == "'\\\""
    assert output.output_bytes("你好".encode()) == r"\xe4\xbd\xa0\xe5\xa5\xbd"
github laixintao / iredis / tests / test_output_function.py View on Github external
def test_output_bytes():
    assert output.output_bytes(b"hello world") == r"hello world"
    assert output.output_bytes(b'hello"world') == r"hello\"world"
    assert output.output_bytes(b"hello'world") == r"hello'world"

    assert output.output_bytes(b'"hello\\world"') == '\\"hello\\\\world\\"'

    assert output.output_bytes(b"'\"") == "'\\\""
    assert output.output_bytes("你好".encode()) == r"\xe4\xbd\xa0\xe5\xa5\xbd"
github laixintao / iredis / tests / test_output_function.py View on Github external
def test_output_bytes():
    assert output.output_bytes(b"hello world") == r"hello world"
    assert output.output_bytes(b'hello"world') == r"hello\"world"
    assert output.output_bytes(b"hello'world") == r"hello'world"

    assert output.output_bytes(b'"hello\\world"') == '\\"hello\\\\world\\"'

    assert output.output_bytes(b"'\"") == "'\\\""
    assert output.output_bytes("你好".encode()) == r"\xe4\xbd\xa0\xe5\xa5\xbd"
github laixintao / iredis / tests / test_output_function.py View on Github external
def test_output_bytes():
    assert output.output_bytes(b"hello world") == r"hello world"
    assert output.output_bytes(b'hello"world') == r"hello\"world"
    assert output.output_bytes(b"hello'world") == r"hello'world"

    assert output.output_bytes(b'"hello\\world"') == '\\"hello\\\\world\\"'

    assert output.output_bytes(b"'\"") == "'\\\""
    assert output.output_bytes("你好".encode()) == r"\xe4\xbd\xa0\xe5\xa5\xbd"
github laixintao / iredis / tests / test_output_function.py View on Github external
def test_output_bytes():
    assert output.output_bytes(b"hello world") == r"hello world"
    assert output.output_bytes(b'hello"world') == r"hello\"world"
    assert output.output_bytes(b"hello'world") == r"hello'world"

    assert output.output_bytes(b'"hello\\world"') == '\\"hello\\\\world\\"'

    assert output.output_bytes(b"'\"") == "'\\\""
    assert output.output_bytes("你好".encode()) == r"\xe4\xbd\xa0\xe5\xa5\xbd"