Skip to content

Commit

Permalink
not touching redis connection during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Miroslav Shubernetskiy committed May 2, 2016
1 parent 5f61dd5 commit 382c5ac
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 382c5ac

Please sign in to comment.