From: Ed Bartosh Date: Sun, 10 Aug 2014 21:40:13 +0000 (+0300) Subject: Fixed mock implementation of hgetall X-Git-Tag: 1.0~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ce030ecd7b6479e0ee9f6e7461cee8d628707d8;p=services%2Fjenkins-scripts.git Fixed mock implementation of hgetall python-redis:hgetall returns empty dictionary if key doesn't exist. This commit fixes this in mock. Previously it returned None in this case. Change-Id: I76f38d15d3918f0b7bbd41d9f3e1907f5e3b61db Signed-off-by: Ed Bartosh --- diff --git a/tests/test_backenddb.py b/tests/test_backenddb.py index 1aa9784..08bb73f 100644 --- a/tests/test_backenddb.py +++ b/tests/test_backenddb.py @@ -106,7 +106,7 @@ class RedisMock(object): def hgetall(self, key): """Get all the fields and values in a hash.""" - return self._dict.get(key) + return self._dict.get(key, {}) def rpush(self, key, item): """Add item to the list."""