Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not touching redis connection during tests #5

Merged
merged 1 commit into from
May 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import mock
from kombu import Connection
from redis import StrictRedis

from celery_redis_sentinel.redis_sentinel import CelerySentinelConnectionPool
from celery_redis_sentinel.transport import SentinelChannel, SentinelTransport
Expand All @@ -12,8 +13,9 @@


class TestSentinelChannel(object):
@mock.patch.object(StrictRedis, 'execute_command') # needed since channel does client.info in __init__
@mock.patch('celery_redis_sentinel.transport.get_redis_via_sentinel')
def test_sentinel_pool(self, mock_get_redis_via_sentinel):
def test_sentinel_pool(self, mock_get_redis_via_sentinel, mock_execute_command):
connection = Connection()
connection.transport_options = BROKER_TRANSPORT_OPTIONS
transport = SentinelTransport(app=app, client=connection)
Expand Down Expand Up @@ -46,6 +48,9 @@ def test_sentinel_pool(self, mock_get_redis_via_sentinel):
('192.168.1.3', 26379)],
service_name='master',
socket_timeout=1,
socket_connect_timeout=mock.ANY,
socket_keepalive=mock.ANY,
socket_keepalive_options=mock.ANY,
)


Expand Down