Skip to content

Commit

Permalink
Update Python tests to avoid immutable config error
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Louie <[email protected]>
  • Loading branch information
jonathanl-bq committed Jan 8, 2025
1 parent aa604c9 commit 833e9aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions python/python/tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,9 @@ async def test_config_get_set(self, glide_client: TGlideClient):

if not await check_if_server_version_lt(glide_client, "7.0.0"):
previous_timeout = await glide_client.config_get(["timeout"])
previous_logfile = await glide_client.config_get(["logfile"])
previous_node_cluster_timeout = await glide_client.config_get(["node-cluster-timeout"])
assert (
await glide_client.config_set({"timeout": "1000", "logfile": "foo"})
await glide_client.config_set({"timeout": "1000", "node-cluster-timeout": "16000"})
== OK
)
assert await glide_client.config_get(["timeout", "logfile"]) == {
Expand All @@ -868,16 +868,16 @@ async def test_config_get_set(self, glide_client: TGlideClient):
}
# revert changes to previous timeout
previous_timeout_decoded = convert_bytes_to_string_object(previous_timeout)
previous_logfile_decoded = convert_bytes_to_string_object(previous_logfile)
previous_node_cluster_timeout_decoded = convert_bytes_to_string_object(pprevious_node_cluster_timeout)
assert isinstance(previous_timeout_decoded, dict)
assert isinstance(previous_logfile_decoded, dict)
assert isinstance(previous_node_cluster_timeout_decoded, dict)
assert isinstance(previous_timeout_decoded["timeout"], str)
assert isinstance(previous_logfile_decoded["logfile"], str)
assert isinstance(previous_node_cluster_timeout_decoded["node-cluster-timeout"], str)
assert (
await glide_client.config_set(
{
"timeout": previous_timeout_decoded["timeout"],
"logfile": previous_logfile_decoded["logfile"],
"node-cluster-timeout": previous_node_cluster_timeout_decoded["node-cluster-timeout"],
}
)
== OK
Expand Down
6 changes: 3 additions & 3 deletions python/python/tests/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ async def transaction_test(
transaction.config_get(["timeout"])
args.append({b"timeout": b"1000"})
if not await check_if_server_version_lt(glide_client, "7.0.0"):
transaction.config_set({"timeout": "2000", "logfile": "foo"})
transaction.config_set({"timeout": "2000", "cluster-node-timeout": "16000"})
args.append(OK)
transaction.config_get(["timeout", "logfile"])
args.append({b"timeout": b"2000", b"logfile": b"foo"})
transaction.config_get(["timeout", "cluster-node-timeout"])
args.append({b"timeout": b"2000", b"cluster-node-timeout": b"16000"})

transaction.hset(key4, {key: value, key2: value2})
args.append(2)
Expand Down

0 comments on commit 833e9aa

Please sign in to comment.