mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-10 13:34:58 -05:00
Merge pull request #456 from matrix-org/store_event_actions
Send unread notification counts
This commit is contained in:
commit
c232780081
19 changed files with 541 additions and 36 deletions
|
|
@ -49,6 +49,12 @@ class FederationTestCase(unittest.TestCase):
|
|||
"get_destination_retry_timings",
|
||||
"set_destination_retry_timings",
|
||||
"have_events",
|
||||
"get_users_in_room",
|
||||
"bulk_get_push_rules",
|
||||
"get_current_state",
|
||||
"set_push_actions_for_event_and_users",
|
||||
"is_guest",
|
||||
"get_state_for_events",
|
||||
]),
|
||||
resource_for_federation=NonCallableMock(),
|
||||
http_client=NonCallableMock(spec_set=[]),
|
||||
|
|
@ -69,6 +75,8 @@ class FederationTestCase(unittest.TestCase):
|
|||
|
||||
self.handlers.federation_handler = FederationHandler(self.hs)
|
||||
|
||||
self.datastore.get_state_for_events.return_value = {"$a:b": {}}
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_msg(self):
|
||||
pdu = FrozenEvent({
|
||||
|
|
@ -85,6 +93,9 @@ class FederationTestCase(unittest.TestCase):
|
|||
|
||||
self.datastore.persist_event.return_value = defer.succeed((1,1))
|
||||
self.datastore.get_room.return_value = defer.succeed(True)
|
||||
self.datastore.get_users_in_room.return_value = ["@a:b"]
|
||||
self.datastore.bulk_get_push_rules.return_value = {}
|
||||
self.datastore.get_current_state.return_value = {}
|
||||
self.auth.check_host_in_room.return_value = defer.succeed(True)
|
||||
|
||||
retry_timings_res = {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,12 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
|
|||
"store_room",
|
||||
"get_latest_events_in_room",
|
||||
"add_event_hashes",
|
||||
"get_users_in_room",
|
||||
"bulk_get_push_rules",
|
||||
"get_current_state",
|
||||
"set_push_actions_for_event_and_users",
|
||||
"get_state_for_events",
|
||||
"is_guest",
|
||||
]),
|
||||
resource_for_federation=NonCallableMock(),
|
||||
http_client=NonCallableMock(spec_set=[]),
|
||||
|
|
@ -90,6 +96,8 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
|
|||
|
||||
self.datastore.persist_event.return_value = (1,1)
|
||||
self.datastore.add_event_hashes.return_value = []
|
||||
self.datastore.get_users_in_room.return_value = ["@bob:red"]
|
||||
self.datastore.bulk_get_push_rules.return_value = {}
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_invite(self):
|
||||
|
|
@ -109,6 +117,8 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
|
|||
self.datastore.get_latest_events_in_room.return_value = (
|
||||
defer.succeed([])
|
||||
)
|
||||
self.datastore.get_current_state.return_value = {}
|
||||
self.datastore.get_state_for_events = lambda event_ids,types: {x: {} for x in event_ids}
|
||||
|
||||
def annotate(_):
|
||||
ctx = Mock()
|
||||
|
|
@ -190,6 +200,8 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
|
|||
self.datastore.get_latest_events_in_room.return_value = (
|
||||
defer.succeed([])
|
||||
)
|
||||
self.datastore.get_current_state.return_value = {}
|
||||
self.datastore.get_state_for_events = lambda event_ids,types: {x: {} for x in event_ids}
|
||||
|
||||
def annotate(_):
|
||||
ctx = Mock()
|
||||
|
|
@ -265,6 +277,8 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
|
|||
self.datastore.get_latest_events_in_room.return_value = (
|
||||
defer.succeed([])
|
||||
)
|
||||
self.datastore.get_current_state.return_value = {}
|
||||
self.datastore.get_state_for_events = lambda event_ids,types: {x: {} for x in event_ids}
|
||||
|
||||
def annotate(_):
|
||||
ctx = Mock()
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class RegistrationStoreTestCase(unittest.TestCase):
|
|||
self.assertEquals(
|
||||
# TODO(paul): Surely this field should be 'user_id', not 'name'
|
||||
# Additionally surely it shouldn't come in a 1-element list
|
||||
{"name": self.user_id, "password_hash": self.pwhash},
|
||||
{"name": self.user_id, "password_hash": self.pwhash, "is_guest": 0},
|
||||
(yield self.store.get_user_by_id(self.user_id))
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue