summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2016-06-15 03:25:49 -0400
committerGitHub <noreply@github.com>2016-06-15 03:25:49 -0400
commiteae07e76b6524e6772be60169549766e7826419a (patch)
tree80b4a73a21b2c494dd72c291c48758a377c19508 /tests/test_commands.py
parent979891cb75ea38b13b14d401a2bcc7cbb2f58714 (diff)
parent6e6c3bdedb2998e26d3ce7d0d2c64a57a45bf3cb (diff)
downloadredis-py-eae07e76b6524e6772be60169549766e7826419a.tar.gz
Merge pull request #698 from mumumu/add_replace_option_to_restore_command
implemented REPLACE modifier of restore command
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py10
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'