summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redis/commands.py9
-rw-r--r--tests/test_commands.py8
2 files changed, 17 insertions, 0 deletions
diff --git a/redis/commands.py b/redis/commands.py
index 4266f9c..48d234e 100644
--- a/redis/commands.py
+++ b/redis/commands.py
@@ -523,6 +523,15 @@ class Commands:
"""
return self.execute_command('LASTSAVE')
+ def lolwut(self, *version_numbers):
+ """Get the Redis version and a piece of generative computer art
+ See: https://redis.io/commands/lolwut
+ """
+ if version_numbers:
+ return self.execute_command('LOLWUT VERSION', *version_numbers)
+ else:
+ return self.execute_command('LOLWUT')
+
def migrate(self, host, port, keys, destination_db, timeout,
copy=False, replace=False, auth=None):
"""
diff --git a/tests/test_commands.py b/tests/test_commands.py
index a283afc..736ae45 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -531,6 +531,14 @@ class TestRedisCommands:
def test_lastsave(self, r):
assert isinstance(r.lastsave(), datetime.datetime)
+ @skip_if_server_version_lt('5.0.0')
+ def test_lolwut(self, r):
+ lolwut = r.lolwut().decode('utf-8')
+ assert 'Redis ver.' in lolwut
+
+ lolwut = r.lolwut(5, 6, 7, 8).decode('utf-8')
+ assert 'Redis ver.' in lolwut
+
def test_object(self, r):
r['a'] = 'foo'
assert isinstance(r.object('refcount', 'a'), int)