diff options
author | netocp <netocalderonp@hotmail.es> | 2019-10-07 21:34:50 -0400 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2020-01-30 13:34:31 -0800 |
commit | a77ad503edb6b511a1cc042607cc318185ea2782 (patch) | |
tree | 96ee3071821aeeaa8a1fa0bdb2870a51c4c82d5e /tests/test_commands.py | |
parent | 272d3139e1c82c2d89551f87d12df7c18d938ea2 (diff) | |
download | redis-py-a77ad503edb6b511a1cc042607cc318185ea2782.tar.gz |
add type filter to scan function
Fixed #1220
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index 00752fa..b2bd2da 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1065,6 +1065,14 @@ class TestRedisCommands(object): _, keys = r.scan(match='a') assert set(keys) == {b'a'} + @skip_if_server_version_lt('5.9.101') + def test_scan_type(self, r): + r.sadd('a-set', 1) + r.hset('a-hash', 'foo', 2) + r.lpush('a-list', 'aux', 3) + _, keys = r.scan(match='a*', _type='SET') + assert set(keys) == {b'a-set'} + @skip_if_server_version_lt('2.8.0') def test_scan_iter(self, r): r.set('a', 1) |