dragonfly/tests/dragonfly/server_family_test.py
Vladislav add252c301
fix(server): Fix QUIT not shutting down connection (#280)
* fix(server): Fix QUIT not shutting down connection

Fixes #170
2022-09-13 05:25:46 +03:00

20 lines
573 B
Python

import pytest
import redis
def test_quit(connection):
connection.send_command("QUIT")
assert connection.read_response() == b'OK'
with pytest.raises(redis.exceptions.ConnectionError) as e:
connection.read_response()
def test_quit_after_sub(connection):
connection = redis.Connection()
connection.send_command("SUBSCRIBE", "foo")
connection.read_response()
connection.send_command("QUIT")
assert connection.read_response() == b'OK'
with pytest.raises(redis.exceptions.ConnectionError) as e:
connection.read_response()