You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sets that have every element removed should answer False to exists, and should not be returned by keys or scan. However, they do. I don't know if sorted sets, lists, hashes, or strings also have this problem
In [1]: import fakeredis
In [2]: import redis
In [3]: r = fakeredis.FakeStrictRedis()
In [4]: r.sadd('s', 1)
Out[4]: 1
In [5]: assert r.exists('s')
In [8]: assert b's' in r.keys()
In [9]: r.srem('s', 1)
Out[9]: 1
In [10]: assert not r.exists('s')
Traceback (most recent call last):
File "", line 1, in
AssertionError
In [11]: assert b's' not in r.keys()
Traceback (most recent call last):
File "", line 1, in
AssertionError
In [12]: r = redis.StrictRedis()
In [13]: r.sadd('s', 1)
Out[13]: 1
In [14]: assert r.exists('s')
In [15]: assert b's' in r.keys()
In [16]: r.srem('s', 1)
Out[16]: 1
In [17]: assert not r.exists('s')
In [18]: assert b's' not in r.keys()
In [19]:
The text was updated successfully, but these errors were encountered:
sets that have every element removed should answer False to exists, and should not be returned by keys or scan. However, they do. I don't know if sorted sets, lists, hashes, or strings also have this problem
In [1]: import fakeredis
In [2]: import redis
In [3]: r = fakeredis.FakeStrictRedis()
In [4]: r.sadd('s', 1)
Out[4]: 1
In [5]: assert r.exists('s')
In [8]: assert b's' in r.keys()
In [9]: r.srem('s', 1)
Out[9]: 1
In [10]: assert not r.exists('s')
Traceback (most recent call last):
File "", line 1, in
AssertionError
In [11]: assert b's' not in r.keys()
Traceback (most recent call last):
File "", line 1, in
AssertionError
In [12]: r = redis.StrictRedis()
In [13]: r.sadd('s', 1)
Out[13]: 1
In [14]: assert r.exists('s')
In [15]: assert b's' in r.keys()
In [16]: r.srem('s', 1)
Out[16]: 1
In [17]: assert not r.exists('s')
In [18]: assert b's' not in r.keys()
In [19]:
The text was updated successfully, but these errors were encountered: