diff --git a/mira/subscription.py b/mira/subscription.py index 4e53ed9..a11e772 100644 --- a/mira/subscription.py +++ b/mira/subscription.py @@ -14,7 +14,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ -# TODO: Replace most of these with a query API import os import json @@ -67,9 +66,9 @@ class SubscriptionManager: every subscription a jid has in the context of @module. """ if not module in self._subscriptions: - return [] + return {} if not jid in self._subscriptions[module]: - return [] + return {} return self._subscriptions[module][jid] diff --git a/tests/test_subscription.py b/tests/test_subscription.py index 2b60f51..781f108 100644 --- a/tests/test_subscription.py +++ b/tests/test_subscription.py @@ -39,8 +39,8 @@ def get_sum(): def test_get_subscriptions_for_jid(): sum = get_sum() - assert sum.get_subscriptions_for_jid('prod', 'a@localhost') == [] - assert sum.get_subscriptions_for_jid('test', 'z@localhost') == [] + assert sum.get_subscriptions_for_jid('prod', 'a@localhost') == {} + assert sum.get_subscriptions_for_jid('test', 'z@localhost') == {} subs = sum.get_subscriptions_for_jid('test', 'a@localhost') assert len(subs.keys()) == 2