Skip to content

Commit 09a0dbb

Browse files
author
Srikalyan Swayampakula
committed
Merge remote-tracking branch 'origin/develop'
Updated the changes and pypi username and password.
2 parents 83b4f5e + 4062e1d commit 09a0dbb

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ install: pip install . --use-mirrors
1010
script: python setup.py nosetests
1111
deploy:
1212
provider: pypi
13-
user: jessemyers
13+
user: github-ll
1414
password:
15-
secure: f7wqGCuSP6dJZ7GwdpQwMc9J0GU8oCK8tydUnvgLNass0U57Eg+PaQURPWxg0T1f5nYACzfche3YHTFeXtk1x7HV6WYWYddin/gv94m7u9+ZQpsrygGizv7eO3lU/vR3K86GrLdTR3z7ii50XDlM0W8XyqHDX1+GGHPWFGLxOHo=
15+
secure: Ol3Gxz2iQEh7Oz64FZJfwLJK/r8QLlnE3aFKv6TkTxn8DedXK+mLUTC0PwueBSOIRGpnxlHwQyzrzxZWs2QOUoyB+Nbx6L1wU+NsgviNKJjAln4/tV4dAeI7GRJD2cDkRH9w2QihWnRFRh7BbmhfsD4WrsELP5k6onbVrQwU/Ao=
1616
on:
1717
tags: true
1818
repo: locationlabs/mockredis

CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
Version 2.9.3
2+
- Support for `from_url`
3+
- Going to remove develop and use master following github flow model.
4+
15
Version 2.9.2
26
- Fixed the versioning issue.
37

48
Version 2.9.1
5-
- Support for `from_url`
69
- Support for `transaction`
710
- Fix `do_expire` method in Python 3
811

mockredis/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def __init__(self,
5959
# Dictionary from script to sha ''Script''
6060
self.shas = dict()
6161

62+
@classmethod
63+
def from_url(cls, url, db=None, **kwargs):
64+
return cls(**kwargs)
65+
6266
# Connection Functions #
6367

6468
def echo(self, msg):
@@ -1536,6 +1540,8 @@ def mock_redis_client(**kwargs):
15361540
"""
15371541
return MockRedis()
15381542

1543+
mock_redis_client.from_url = mock_redis_client
1544+
15391545

15401546
def mock_strict_redis_client(**kwargs):
15411547
"""
@@ -1544,3 +1550,5 @@ def mock_strict_redis_client(**kwargs):
15441550
instead of a StrictRedis object.
15451551
"""
15461552
return MockRedis(strict=True)
1553+
1554+
mock_strict_redis_client.from_url = mock_strict_redis_client

mockredis/tests/test_factories.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,22 @@ def test_mock_redis_client():
1313
ok_(not mock_redis_client(host="localhost", port=6379).strict)
1414

1515

16+
def test_mock_redis_client_from_url():
17+
"""
18+
Test that we can pass kwargs to the Redis from_url mock/patch target.
19+
"""
20+
ok_(not mock_redis_client.from_url(host="localhost", port=6379).strict)
21+
22+
1623
def test_mock_strict_redis_client():
1724
"""
1825
Test that we can pass kwargs to the StrictRedis mock/patch target.
1926
"""
2027
ok_(mock_strict_redis_client(host="localhost", port=6379).strict)
28+
29+
30+
def test_mock_strict_redis_client_from_url():
31+
"""
32+
Test that we can pass kwargs to the StrictRedis from_url mock/patch target.
33+
"""
34+
ok_(mock_strict_redis_client.from_url(host="localhost", port=6379).strict)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup, find_packages
44

55
# Match releases to redis-py versions
6-
__version__ = '2.9.2'
6+
__version__ = '2.9.3'
77

88
# Jenkins will replace __build__ with a unique value.
99
__build__ = ''

0 commit comments

Comments
 (0)