Skip to content

Commit c44ae96

Browse files
committed
Add redis coverage test
It was possible, though rare, for the stateful test to skip a method every time.
1 parent ae0011a commit c44ae96

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

hypothesis-python/tests/redis/test_redis_exampledatabase.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ def test_invalid_args_raise(kw):
3636
RedisExampleDatabase(**kw)
3737

3838

39+
def test_all_methods():
40+
db = RedisExampleDatabase(FakeRedis())
41+
db.save(b"key1", b"value")
42+
assert list(db.fetch(b"key1")) == [b"value"]
43+
db.move(b"key1", b"key2", b"value")
44+
assert list(db.fetch(b"key1")) == []
45+
assert list(db.fetch(b"key2")) == [b"value"]
46+
db.delete(b"key2", b"value")
47+
assert list(db.fetch(b"key2")) == []
48+
db.delete(b"key2", b"unknown value")
49+
50+
3951
class DatabaseComparison(RuleBasedStateMachine):
4052
def __init__(self):
4153
super().__init__()

0 commit comments

Comments
 (0)