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

Method test_config_set_for_search_module

tests/test_commands.py:1054–1074  ·  view source on GitHub ↗
(self, r: redis.Redis)

Source from the content-addressed store, hash-verified

1052 @pytest.mark.redismod
1053 @skip_if_server_version_lt("7.9.0")
1054 def test_config_set_for_search_module(self, r: redis.Redis):
1055 initial_default_search_dialect = r.config_get("*")["search-default-dialect"]
1056 try:
1057 default_dialect_new = "3"
1058 assert r.config_set("search-default-dialect", default_dialect_new)
1059 assert r.config_get("*")["search-default-dialect"] == default_dialect_new
1060 search_config = r.ft().config_get("*")
1061 if expects_resp2_shape(r) or expects_resp3_shape(r):
1062 dialect = search_config[b"DEFAULT_DIALECT"].decode()
1063 elif expects_unified_shape(r):
1064 dialect = search_config["DEFAULT_DIALECT"]
1065 assert dialect == default_dialect_new
1066 except AssertionError as ex:
1067 raise ex
1068 finally:
1069 assert r.config_set(
1070 "search-default-dialect", initial_default_search_dialect
1071 )
1072
1073 with pytest.raises(exceptions.ResponseError):
1074 r.config_set("search-max-doctablesize", 2000000)
1075
1076 @skip_if_server_version_lt("6.0.0")
1077 @skip_if_redis_enterprise()

Callers

nothing calls this directly

Calls 7

expects_resp2_shapeFunction · 0.85
expects_resp3_shapeFunction · 0.85
expects_unified_shapeFunction · 0.85
decodeMethod · 0.80
config_getMethod · 0.45
config_setMethod · 0.45
ftMethod · 0.45

Tested by

no test coverage detected