summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-11-14 21:20:31 -0800
committerAndy McCurdy <andy@andymccurdy.com>2018-11-14 21:20:31 -0800
commit04af0d6456195c15b9a881c5fa9aed95bf51a8ca (patch)
tree1ae533214cd04e97f520265ac538b25be88b0194 /tests
parent0ef90870872b7a284af8d5238c939802d1e08fca (diff)
downloadredis-py-04af0d6456195c15b9a881c5fa9aed95bf51a8ca.tar.gz
Add test to make sure geodist with a missing member returns None
Fixes #939
Diffstat (limited to 'tests')
-rw-r--r--tests/test_commands.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index e2e3cbb..768d49f 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1601,6 +1601,12 @@ class TestRedisCommands(object):
assert r.geodist('barcelona', 'place1', 'place2', 'km') == 3.0674
@skip_if_server_version_lt('3.2.0')
+ def test_geodist_missing_one_member(self, r):
+ values = (2.1909389952632, 41.433791470673, 'place1')
+ r.geoadd('barcelona', *values)
+ assert r.geodist('barcelona', 'place1', 'missing_member', 'km') is None
+
+ @skip_if_server_version_lt('3.2.0')
def test_geodist_invalid_units(self, r):
with pytest.raises(exceptions.RedisError):
assert r.geodist('x', 'y', 'z', 'inches')