Skip to content

Commit

Permalink
fix merge and new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Adar Ovadia committed Jun 30, 2024
1 parent 5666344 commit d8d262a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions python/python/tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6950,7 +6950,7 @@ async def test_function_delete(self, redis_client: TGlideClient):
code = generate_lua_lib_code(lib_name, {func_name: "return args[1]"}, True)

# Load the function
assert await redis_client.function_load(code) == lib_name
assert await redis_client.function_load(code) == lib_name.encode()

# TODO: Ensure the library exists with FUNCTION LIST

Expand Down Expand Up @@ -6980,7 +6980,7 @@ async def test_function_delete_with_routing(
route = SlotKeyRoute(SlotType.PRIMARY, "1") if single_route else AllPrimaries()

# Load the function
assert await redis_client.function_load(code, False, route) == lib_name
assert await redis_client.function_load(code, False, route) == lib_name.encode()

# TODO: Ensure the library exists with FUNCTION LIST

Expand Down Expand Up @@ -7333,10 +7333,10 @@ async def test_lcs(self, redis_client: GlideClient):
expected_subsequence = "acd"
expected_subsequence_with_nonexistent_key = ""
assert await redis_client.mset({key1: value1, key2: value2}) == OK
assert await redis_client.lcs(key1, key2) == expected_subsequence
assert await redis_client.lcs(key1, key2) == expected_subsequence.encode()
assert (
await redis_client.lcs(key1, nonexistent_key)
== expected_subsequence_with_nonexistent_key
== expected_subsequence_with_nonexistent_key.encode()
)
lcs_non_string_key = "lcs_non_string_key"
assert await redis_client.sadd(lcs_non_string_key, ["Hello", "world"]) == 2
Expand Down Expand Up @@ -7379,7 +7379,7 @@ async def test_lcs_idx(self, redis_client: GlideClient):
value2 = "bcdef1234"
nonexistent_key = "nonexistent_key"
expected_response_no_min_match_len_no_with_match_len = {
"matches": [
b"matches": [
[
[4, 7],
[5, 8],
Expand All @@ -7389,19 +7389,19 @@ async def test_lcs_idx(self, redis_client: GlideClient):
[0, 2],
],
],
"len": 7,
b"len": 7,
}
expected_response_with_min_match_len_equals_four_no_with_match_len = {
"matches": [
b"matches": [
[
[4, 7],
[5, 8],
],
],
"len": 7,
b"len": 7,
}
expected_response_no_min_match_len_with_match_len = {
"matches": [
b"matches": [
[
[4, 7],
[5, 8],
Expand All @@ -7413,21 +7413,21 @@ async def test_lcs_idx(self, redis_client: GlideClient):
3,
],
],
"len": 7,
b"len": 7,
}
expected_response_with_min_match_len_equals_four_and_with_match_len = {
"matches": [
b"matches": [
[
[4, 7],
[5, 8],
4,
],
],
"len": 7,
b"len": 7,
}
expected_response_with_nonexistent_key = {
"matches": [],
"len": 0,
b"matches": [],
b"len": 0,
}
assert await redis_client.mset({key1: value1, key2: value2}) == OK
assert (
Expand Down
12 changes: 6 additions & 6 deletions python/python/tests/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ async def transaction_test(
transaction.srem(key7, ["foo"])
args.append(1)
transaction.sscan(key7, "0")
args.append(["0", ["bar"]])
args.append([b"0", [b"bar"]])
transaction.sscan(key7, "0", match="*", count=10)
args.append(["0", ["bar"]])
args.append([b"0", [b"bar"]])
transaction.smembers(key7)
args.append({b"bar"})
transaction.scard(key7)
Expand Down Expand Up @@ -626,15 +626,15 @@ async def transaction_test(
transaction.mset({key23: "abcd1234", key24: "bcdef1234"})
args.append(OK)
transaction.lcs(key23, key24)
args.append("bcd1234")
args.append(b"bcd1234")
transaction.lcs_len(key23, key24)
args.append(7)
transaction.lcs_idx(key23, key24)
args.append({"matches": [[[4, 7], [5, 8]], [[1, 3], [0, 2]]], "len": 7})
args.append({b"matches": [[[4, 7], [5, 8]], [[1, 3], [0, 2]]], b"len": 7})
transaction.lcs_idx(key23, key24, min_match_len=4)
args.append({"matches": [[[4, 7], [5, 8]]], "len": 7})
args.append({b"matches": [[[4, 7], [5, 8]]], b"len": 7})
transaction.lcs_idx(key23, key24, with_match_len=True)
args.append({"matches": [[[4, 7], [5, 8], 4], [[1, 3], [0, 2], 3]], "len": 7})
args.append({b"matches": [[[4, 7], [5, 8], 4], [[1, 3], [0, 2], 3]], b"len": 7})

return args

Expand Down

0 comments on commit d8d262a

Please sign in to comment.