diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2020-02-25 13:25:25 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2020-02-25 13:25:25 -0800 |
commit | e57daf554d6a4a66373de6605d13fb7a185852e9 (patch) | |
tree | ae39d655d6da1f55493ba81fbcd5bb3fdd1c0999 /tests/test_commands.py | |
parent | 3310fe415a4c3a6ec9a9fcaf9a9fa24808219429 (diff) | |
download | redis-py-e57daf554d6a4a66373de6605d13fb7a185852e9.tar.gz |
add support for the MEMORY STATS command
Fixes #1268
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index 7f1e33e..fc85b5f 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -2600,6 +2600,17 @@ class TestRedisCommands(object): assert resp == [0, None, 255] @skip_if_server_version_lt('4.0.0') + def test_memory_stats(self, r): + # put a key into the current db to make sure that "db.<current-db>" + # has data + r.set('foo', 'bar') + stats = r.memory_stats() + assert isinstance(stats, dict) + for key, value in iteritems(stats): + if key.startswith('db.'): + assert isinstance(value, dict) + + @skip_if_server_version_lt('4.0.0') def test_memory_usage(self, r): r.set('foo', 'bar') assert isinstance(r.memory_usage('foo'), int) |