summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authoriandyh <mail@andyh.io>2016-02-18 16:01:05 +0900
committeriandyh <mail@andyh.io>2016-02-18 16:07:16 +0900
commitfa3e17aa2e3b1dfd6edf7f5c0952f567d651ec9d (patch)
tree75325ba85672c823447ee20cf7badb666f2cd11d /tests/conftest.py
parentf5fbb74222eecef5ed9997fc9d44cdcfcd5f1bcd (diff)
downloadredis-py-fa3e17aa2e3b1dfd6edf7f5c0952f567d651ec9d.tar.gz
format long mocked response string
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 7d22349..4739159 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -72,14 +72,35 @@ def mock_cluster_resp_int(request, **kwargs):
@pytest.fixture()
def mock_cluster_resp_info(request, **kwargs):
r = _get_client(redis.Redis, request, **kwargs)
- response = 'cluster_state:ok\r\ncluster_slots_assigned:16384\r\ncluster_slots_ok:16384\r\ncluster_slots_pfail:0\r\ncluster_slots_fail:0\r\ncluster_known_nodes:7\r\ncluster_size:3\r\ncluster_current_epoch:7\r\ncluster_my_epoch:2\r\ncluster_stats_messages_sent:170262\r\ncluster_stats_messages_received:105653\r\n'
+ response = ('cluster_state:ok\r\ncluster_slots_assigned:16384\r\n'
+ 'cluster_slots_ok:16384\r\ncluster_slots_pfail:0\r\n'
+ 'cluster_slots_fail:0\r\ncluster_known_nodes:7\r\n'
+ 'cluster_size:3\r\ncluster_current_epoch:7\r\n'
+ 'cluster_my_epoch:2\r\ncluster_stats_messages_sent:170262\r\n'
+ 'cluster_stats_messages_received:105653\r\n')
return _gen_cluster_mock_resp(r, response)
@pytest.fixture()
def mock_cluster_resp_nodes(request, **kwargs):
r = _get_client(redis.Redis, request, **kwargs)
- response = 'c8253bae761cb1ecb2b61857d85dfe455a0fec8b 172.17.0.7:7006 slave aa90da731f673a99617dfe930306549a09f83a6b 0 1447836263059 5 connected\n9bd595fe4821a0e8d6b99d70faa660638a7612b3 172.17.0.7:7008 master - 0 1447836264065 0 connected\naa90da731f673a99617dfe930306549a09f83a6b 172.17.0.7:7003 myself,master - 0 0 2 connected 5461-10922\n1df047e5a594f945d82fc140be97a1452bcbf93e 172.17.0.7:7007 slave 19efe5a631f3296fdf21a5441680f893e8cc96ec 0 1447836262556 3 connected\n4ad9a12e63e8f0207025eeba2354bcf4c85e5b22 172.17.0.7:7005 master - 0 1447836262555 7 connected 0-5460\n19efe5a631f3296fdf21a5441680f893e8cc96ec 172.17.0.7:7004 master - 0 1447836263562 3 connected 10923-16383\nfbb23ed8cfa23f17eaf27ff7d0c410492a1093d6 172.17.0.7:7002 master,fail - 1447829446956 1447829444948 1 disconnected\n'
+ response = ('c8253bae761cb1ecb2b61857d85dfe455a0fec8b 172.17.0.7:7006 '
+ 'slave aa90da731f673a99617dfe930306549a09f83a6b 0 '
+ '1447836263059 5 connected\n'
+ '9bd595fe4821a0e8d6b99d70faa660638a7612b3 172.17.0.7:7008 '
+ 'master - 0 1447836264065 0 connected\n'
+ 'aa90da731f673a99617dfe930306549a09f83a6b 172.17.0.7:7003 '
+ 'myself,master - 0 0 2 connected 5461-10922\n'
+ '1df047e5a594f945d82fc140be97a1452bcbf93e 172.17.0.7:7007 '
+ 'slave 19efe5a631f3296fdf21a5441680f893e8cc96ec 0 '
+ '1447836262556 3 connected\n'
+ '4ad9a12e63e8f0207025eeba2354bcf4c85e5b22 172.17.0.7:7005 '
+ 'master - 0 1447836262555 7 connected 0-5460\n'
+ '19efe5a631f3296fdf21a5441680f893e8cc96ec 172.17.0.7:7004 '
+ 'master - 0 1447836263562 3 connected 10923-16383\n'
+ 'fbb23ed8cfa23f17eaf27ff7d0c410492a1093d6 172.17.0.7:7002 '
+ 'master,fail - 1447829446956 1447829444948 1 disconnected\n'
+ )
return _gen_cluster_mock_resp(r, response)