fix: Inconsistency in get_subscriptions_for_jid
This commit is contained in:
parent
34d001b5bc
commit
498b399813
@ -14,7 +14,6 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
# TODO: Replace most of these with a query API
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
|
||||||
@ -67,9 +66,9 @@ class SubscriptionManager:
|
|||||||
every subscription a jid has in the context of @module.
|
every subscription a jid has in the context of @module.
|
||||||
"""
|
"""
|
||||||
if not module in self._subscriptions:
|
if not module in self._subscriptions:
|
||||||
return []
|
return {}
|
||||||
if not jid in self._subscriptions[module]:
|
if not jid in self._subscriptions[module]:
|
||||||
return []
|
return {}
|
||||||
|
|
||||||
return self._subscriptions[module][jid]
|
return self._subscriptions[module][jid]
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ def get_sum():
|
|||||||
def test_get_subscriptions_for_jid():
|
def test_get_subscriptions_for_jid():
|
||||||
sum = get_sum()
|
sum = get_sum()
|
||||||
|
|
||||||
assert sum.get_subscriptions_for_jid('prod', 'a@localhost') == []
|
assert sum.get_subscriptions_for_jid('prod', 'a@localhost') == {}
|
||||||
assert sum.get_subscriptions_for_jid('test', 'z@localhost') == []
|
assert sum.get_subscriptions_for_jid('test', 'z@localhost') == {}
|
||||||
|
|
||||||
subs = sum.get_subscriptions_for_jid('test', 'a@localhost')
|
subs = sum.get_subscriptions_for_jid('test', 'a@localhost')
|
||||||
assert len(subs.keys()) == 2
|
assert len(subs.keys()) == 2
|
||||||
|
Loading…
Reference in New Issue
Block a user