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

fix tests, fix compatibility with celery 3.1.x #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion celery_redis_sentinel/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .backend import RedisSentinelBackend
from .transport import SentinelTransport

if celery.VERSION.major < 4:
if celery.VERSION[0] < 4:
from celery.backends import BACKEND_ALIASES
else:
from celery.app.backends import BACKEND_ALIASES
Expand Down
1 change: 1 addition & 0 deletions celery_redis_sentinel/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def sentinel_pool(self):
CelerySentinelConnectionPool
Connection pool instance connected to redis sentinel
"""

params = self._connparams()
params.update({
'sentinels': self.sentinels,
Expand Down
1 change: 1 addition & 0 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_client(self, mock_get_redis_via_sentinel):
('192.168.1.3', 26379)],
service_name='master',
socket_timeout=1,
socket_connect_timeout=mock.ANY,
host=mock.ANY,
max_connections=mock.ANY,
password=mock.ANY,
Expand Down
7 changes: 6 additions & 1 deletion tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
from __future__ import absolute_import, print_function, unicode_literals

import mock
from celery.backends import BACKEND_ALIASES
from kombu.transport import TRANSPORT_ALIASES
import celery

from celery_redis_sentinel.register import get_class_path, register

if celery.VERSION[0] < 4:
from celery.backends import BACKEND_ALIASES
else:
from celery.app.backends import BACKEND_ALIASES


class Foo(object):
pass
Expand Down
1 change: 1 addition & 0 deletions tests/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_sentinel_pool(self, mock_get_redis_via_sentinel, mock_execute_command):
password=mock.ANY,
port=mock.ANY,
connection_pool_class=CelerySentinelConnectionPool,
connection_class=mock.ANY,
redis_class=channel.Client,
db=0,
sentinels=[('192.168.1.1', 26379),
Expand Down