diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index e2b7bcb..11a56e2 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -1006,7 +1006,7 @@ class Client(object): >>> client.update_storage({'storage': {"entry 1": "value 1", "entry 2": "value 2", "entry 3": "value 3"}}) >>> client.get_storage() {'result': 'success', 'storage': {"entry 1": "value 1", "entry 2": "value 2", "entry 3": "value 3"}, 'msg': ''} - >>> client.get_storage(keys=('entry 1', 'entry 3')) + >>> client.get_storage({'keys': ["entry 1", "entry 3"]}) {'result': 'success', 'storage': {'entry 1': 'value 1', 'entry 3': 'value 3'}, 'msg': ''} ''' return self.call_endpoint( diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index 4221248..f4a4b08 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -69,7 +69,7 @@ class StateHandler(object): if key in self.state_: return self.demarshal(self.state_[key]) - response = self._client.get_storage(keys=(key,)) + response = self._client.get_storage({'keys': [key]}) if response['result'] != 'success': raise StateHandlerError("Error fetching state: {}".format(str(response))) diff --git a/zulip_bots/zulip_bots/tests/test_lib.py b/zulip_bots/zulip_bots/tests/test_lib.py index 253d965..5c0ac30 100644 --- a/zulip_bots/zulip_bots/tests/test_lib.py +++ b/zulip_bots/zulip_bots/tests/test_lib.py @@ -27,7 +27,7 @@ class FakeClient: result='success', ) - def get_storage(self, keys): + def get_storage(self, request): return dict( result='success', storage=self.storage, @@ -97,7 +97,7 @@ class LibTest(TestCase): result='success', storage=dict(non_cached_key='[5]'))) val = state_handler.get('non_cached_key') - client.get_storage.assert_called_with(keys=('non_cached_key',)) + client.get_storage.assert_called_with({'keys': ['non_cached_key']}) self.assertEqual(val, [5]) # value must already be cached