Skip to content

Commit 376d2d3

Browse files
committed
fix: check resp3 decode #393
1 parent c8e9d27 commit 376d2d3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test_mixins/test_streams_commands.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ def add_items(r: redis.Redis, stream: str, n: int):
2222
return id_list
2323

2424

25+
@pytest.mark.resp3_only
26+
@pytest.mark.decode_responses
27+
def test_xadd_xread_resp3(r: redis.Redis):
28+
stream = "stream"
29+
fields = {"some": "other"}
30+
m1 = r.xadd(stream, fields=fields)
31+
res = r.xread({stream: "0-0"}, block=0)
32+
assert isinstance(res, dict)
33+
assert stream in res
34+
assert res[stream] == [[(m1, fields)]]
35+
36+
2537
def test_xadd_redis__green(r: redis.Redis):
2638
stream = "stream"
2739
before = int(1000 * time.time())

0 commit comments

Comments
 (0)