summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--redis/client.py4
-rw-r--r--tests/server_commands.py3
3 files changed, 8 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 7adc63e..4bc4ea1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,5 @@
* 2.4.10 (in development)
+ * Added the ECHO command for completeness.
* Fixed a bug where attempting to subscribe to a PubSub channel of a Redis
server that's down would blow out the stack. Fixes #179 and #195. Thanks
Ovidiu Predescu for the test case.
diff --git a/redis/client.py b/redis/client.py
index f752cae..948c1dc 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -293,6 +293,10 @@ class StrictRedis(object):
return self.execute_command('DEL', *names)
__delitem__ = delete
+ def echo(self, value):
+ "Echo the string back from the server"
+ return self.execute_command('ECHO', value)
+
def flushall(self):
"Delete all keys in all databases on the current host"
return self.execute_command('FLUSHALL')
diff --git a/tests/server_commands.py b/tests/server_commands.py
index 771e0b3..819bedf 100644
--- a/tests/server_commands.py
+++ b/tests/server_commands.py
@@ -81,6 +81,9 @@ class ServerCommandsTestCase(unittest.TestCase):
self.assert_(self.client.config_set('dbfilename', rdbname))
self.assertEquals(self.client.config_get()['dbfilename'], rdbname)
+ def test_echo(self):
+ self.assertEquals(self.client.echo('foo bar'), 'foo bar')
+
def test_info(self):
self.client['a'] = 'foo'
self.client['b'] = 'bar'