Skip to content

Commit

Permalink
Fix bug: new stream id used for test_streams
Browse files Browse the repository at this point in the history
  • Loading branch information
NoneGG committed Jun 2, 2019
1 parent f61ec92 commit a53c35b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/client/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def test_xreadgroup(self, r):
with pytest.raises(ResponseError) as exc:
await r.xreadgroup('wrong_group', 'lalala', count=10, block=10, test_stream='1')
assert await r.xgroup_create('test_stream', 'test_group', '0') is True
entries = await r.xreadgroup('test_group', 'consumer1', count=5, test_stream='1')
entries = await r.xreadgroup('test_group', 'consumer1', count=5, test_stream='>')
assert len(entries[b'test_stream']) == 5

@skip_if_server_version_lt('4.9.103')
Expand Down Expand Up @@ -132,7 +132,7 @@ async def test_xgroup_set_id(self, r):
group_info = await r.xinfo_groups('test_stream')
assert group_info[0][b'pending'] == 0
assert await r.xgroup_set_id('test_stream', 'test_group', '0') is True
await r.xreadgroup('test_group', 'consumer1', count=5, test_stream='1')
await r.xreadgroup('test_group', 'consumer1', count=5, test_stream='>')
group_info = await r.xinfo_groups('test_stream')
assert group_info[0][b'pending'] == 5

Expand Down Expand Up @@ -179,11 +179,11 @@ async def test_xpending(self, r):
assert group_info[0][b'pending'] == 0
assert len(await r.xpending('test_stream', 'test_group', count=10, consumer='consumer1')) == 0
assert await r.xgroup_set_id('test_stream', 'test_group', '0') is True
await r.xreadgroup('test_group', 'consumer1', count=5, test_stream='1')
await r.xreadgroup('test_group', 'consumer1', count=5, test_stream='>')
group_info = await r.xinfo_groups('test_stream')
assert group_info[0][b'pending'] == 5
assert len(await r.xpending('test_stream', 'test_group', count=10, consumer='consumer1')) == 5
xpending_entries_in_range = await r.xpending('test_stream', 'test_group', start='1', end='2', count=10,
xpending_entries_in_range = await r.xpending('test_stream', 'test_group', start='2', end='2', count=10,
consumer='consumer1')
assert len(xpending_entries_in_range) == 1
assert xpending_entries_in_range[0][0] == b'2-0'

0 comments on commit a53c35b

Please sign in to comment.