diff options
| author | Daniel Williams <dwilliams@kenzan.com> | 2018-10-19 10:26:56 -0600 |
|---|---|---|
| committer | Daniel Williams <dwilliams@kenzan.com> | 2018-10-19 10:26:56 -0600 |
| commit | 80af0ad26838ea243c2aefdbeee5ec8188750399 (patch) | |
| tree | 3bb72102788f0220680a12dfbe02e1cba91c65ea | |
| parent | 676cd3987639b1bad5263d2a0ce5861827d63d3e (diff) | |
| download | redis-py-80af0ad26838ea243c2aefdbeee5ec8188750399.tar.gz | |
Adding a couple of tests for the SHUTDOWN command and the added NOSAVE option.
| -rw-r--r-- | tests/test_commands.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index b9b9b66..3ab1be1 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -126,6 +126,34 @@ class TestRedisCommands(object): def test_ping(self, r): assert r.ping() + def test_shutdown(self, r): + r.shutdown() + # Attempt to ping the server after the shutdown. The library should + # reconnect, but will return a connection error for the next couple + # of attempts. This loop will reattempt a ping until a success or + # one second timeout. + for i in range(10): + try: + r.ping() + break + except: + time.sleep(0.1) + assert r.ping() + + def test_shutdown_nosave(self, r): + r.shutdown(save=False) + # Attempt to ping the server after the shutdown. The library should + # reconnect, but will return a connection error for the next couple + # of attempts. This loop will reattempt a ping until a success or + # one second timeout. + for i in range(10): + try: + r.ping() + break + except: + time.sleep(0.1) + assert r.ping() + def test_slowlog_get(self, r, slowlog): assert r.slowlog_reset() unicode_string = unichr(3456) + u('abcd') + unichr(3421) |
