diff options
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index 06b19b7..246ef65 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -285,6 +285,16 @@ class TestRedisCommands(object): r.restore('a', 0, dumped) assert r['a'] == b('foo') + @skip_if_server_version_lt('3.0.0') + def test_dump_and_restore_and_replace(self, r): + r['a'] = 'bar' + dumped = r.dump('a') + with pytest.raises(redis.ResponseError): + r.restore('a', 0, dumped) + + r.restore('a', 0, dumped, replace=True) + assert r['a'] == b('bar') + def test_exists(self, r): assert not r.exists('a') r['a'] = 'foo' |