summary refs log tree commit diff
path: root/tests/appservice
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-11 10:36:08 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-11 10:36:08 +0000
commitc7783d6feec9b69c24f3303cbb51cce3e6b8ffb3 (patch)
tree0b15fab036089ac0d9516c8b74a2976c5566b94d /tests/appservice
parentMerge branch 'develop' into application-services (diff)
downloadsynapse-c7783d6feec9b69c24f3303cbb51cce3e6b8ffb3.tar.xz
Notify ASes for events sent by other users in a room which an AS user is a part of.
Diffstat (limited to '')
-rw-r--r--tests/appservice/test_appservice.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/appservice/test_appservice.py b/tests/appservice/test_appservice.py
index c0aaf12785..d12e4f2644 100644
--- a/tests/appservice/test_appservice.py
+++ b/tests/appservice/test_appservice.py
@@ -143,3 +143,28 @@ class ApplicationServiceTestCase(unittest.TestCase):
             restrict_to=ApplicationService.NS_USERS,
             aliases_for_event=["#xmpp_barfoo:matrix.org"]
         ))
+
+    def test_member_list_match(self):
+        self.service.namespaces[ApplicationService.NS_USERS].append(
+            "@irc_.*"
+        )
+        join_list = [
+            Mock(
+                type="m.room.member", room_id="!foo:bar", sender="@alice:here",
+                state_key="@alice:here"
+            ),
+            Mock(
+                type="m.room.member", room_id="!foo:bar", sender="@irc_fo:here",
+                state_key="@irc_fo:here"  # AS user
+            ),
+            Mock(
+                type="m.room.member", room_id="!foo:bar", sender="@bob:here",
+                state_key="@bob:here"
+            )
+        ]
+
+        self.event.sender = "@xmpp_foobar:matrix.org"
+        self.assertTrue(self.service.is_interested(
+            event=self.event,
+            member_list=join_list
+        ))