mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 23:03:51 +01:00
Fix a couple more storage tests
This commit is contained in:
parent
2fcce3b3c5
commit
3791b75000
2 changed files with 32 additions and 16 deletions
|
@ -51,16 +51,22 @@ class RoomMemberStoreTestCase(unittest.TestCase):
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def inject_room_member(self, room, user, membership):
|
def inject_room_member(self, room, user, membership):
|
||||||
# Have to create a join event using the eventfactory
|
# Have to create a join event using the eventfactory
|
||||||
|
event = self.event_factory.create_event(
|
||||||
|
etype=RoomMemberEvent.TYPE,
|
||||||
|
user_id=user.to_string(),
|
||||||
|
state_key=user.to_string(),
|
||||||
|
room_id=room.to_string(),
|
||||||
|
membership=membership,
|
||||||
|
content={"membership": membership},
|
||||||
|
depth=1,
|
||||||
|
prev_events=[],
|
||||||
|
)
|
||||||
|
|
||||||
|
event.state_events = None
|
||||||
|
event.hashes = {}
|
||||||
|
|
||||||
yield self.store.persist_event(
|
yield self.store.persist_event(
|
||||||
self.event_factory.create_event(
|
event
|
||||||
etype=RoomMemberEvent.TYPE,
|
|
||||||
user_id=user.to_string(),
|
|
||||||
state_key=user.to_string(),
|
|
||||||
room_id=room.to_string(),
|
|
||||||
membership=membership,
|
|
||||||
content={"membership": membership},
|
|
||||||
depth=1,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
|
|
@ -59,8 +59,12 @@ class StreamStoreTestCase(unittest.TestCase):
|
||||||
membership=membership,
|
membership=membership,
|
||||||
content={"membership": membership},
|
content={"membership": membership},
|
||||||
depth=self.depth,
|
depth=self.depth,
|
||||||
|
prev_events=[],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
event.state_events = None
|
||||||
|
event.hashes = {}
|
||||||
|
|
||||||
if prev_state:
|
if prev_state:
|
||||||
event.prev_state = prev_state
|
event.prev_state = prev_state
|
||||||
|
|
||||||
|
@ -75,15 +79,21 @@ class StreamStoreTestCase(unittest.TestCase):
|
||||||
def inject_message(self, room, user, body):
|
def inject_message(self, room, user, body):
|
||||||
self.depth += 1
|
self.depth += 1
|
||||||
|
|
||||||
|
event = self.event_factory.create_event(
|
||||||
|
etype=MessageEvent.TYPE,
|
||||||
|
user_id=user.to_string(),
|
||||||
|
room_id=room.to_string(),
|
||||||
|
content={"body": body, "msgtype": u"message"},
|
||||||
|
depth=self.depth,
|
||||||
|
prev_events=[],
|
||||||
|
)
|
||||||
|
|
||||||
|
event.state_events = None
|
||||||
|
event.hashes = {}
|
||||||
|
|
||||||
# Have to create a join event using the eventfactory
|
# Have to create a join event using the eventfactory
|
||||||
yield self.store.persist_event(
|
yield self.store.persist_event(
|
||||||
self.event_factory.create_event(
|
event
|
||||||
etype=MessageEvent.TYPE,
|
|
||||||
user_id=user.to_string(),
|
|
||||||
room_id=room.to_string(),
|
|
||||||
content={"body": body, "msgtype": u"message"},
|
|
||||||
depth=self.depth,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
|
Loading…
Reference in a new issue