MCPcopy
hub / github.com/redis/redis-py / _select_expected

Function _select_expected

tests/conftest.py:896–910  ·  view source on GitHub ↗
(r, resp2_expected, resp3_expected, unified_expected)

Source from the content-addressed store, hash-verified

894
895
896def _select_expected(r, resp2_expected, resp3_expected, unified_expected):
897 match expected_response_shape(r):
898 case "legacy_resp2":
899 return resp2_expected
900 case "legacy_resp3":
901 return resp3_expected
902 case "unified":
903 # Fall back to ``resp3_expected`` when no dedicated
904 # ``unified_expected`` is supplied, since unified shapes are
905 # typically RESP3-style with only a few divergences.
906 if unified_expected is _UNSET:
907 return resp3_expected
908 return unified_expected
909 case other:
910 raise ValueError(f"unknown response shape: {other!r}")
911
912
913def assert_resp_response(

Callers 2

assert_resp_responseFunction · 0.85
assert_resp_response_inFunction · 0.85

Calls 1

expected_response_shapeFunction · 0.85

Tested by

no test coverage detected