forked from MirrorHub/synapse
cleanups
This commit is contained in:
parent
77078d6c8e
commit
8d62baa48c
|
@ -35,7 +35,7 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
|
|
||||||
# Figure out what the most recent event is
|
# Figure out what the most recent event is
|
||||||
most_recent = self.successResultOf(
|
most_recent = self.successResultOf(
|
||||||
self.homeserver.datastore.get_latest_event_ids_in_room(self.room_id)
|
maybeDeferred(self.homeserver.datastore.get_latest_event_ids_in_room, self.room_id)
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
join_event = FrozenEvent(
|
join_event = FrozenEvent(
|
||||||
|
@ -72,7 +72,7 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
# Make sure we actually joined the room
|
# Make sure we actually joined the room
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.successResultOf(
|
self.successResultOf(
|
||||||
self.homeserver.datastore.get_latest_event_ids_in_room(self.room_id)
|
maybeDeferred(self.homeserver.datastore.get_latest_event_ids_in_room, self.room_id)
|
||||||
)[0],
|
)[0],
|
||||||
"$join:test.serv",
|
"$join:test.serv",
|
||||||
)
|
)
|
||||||
|
@ -92,7 +92,7 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
|
|
||||||
# Figure out what the most recent event is
|
# Figure out what the most recent event is
|
||||||
most_recent = self.successResultOf(
|
most_recent = self.successResultOf(
|
||||||
self.homeserver.datastore.get_latest_event_ids_in_room(self.room_id)
|
maybeDeferred(self.homeserver.datastore.get_latest_event_ids_in_room, self.room_id)
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
# Now lie about an event
|
# Now lie about an event
|
||||||
|
@ -129,7 +129,7 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make sure the invalid event isn't there
|
# Make sure the invalid event isn't there
|
||||||
extrem = self.homeserver.datastore.get_latest_event_ids_in_room(self.room_id)
|
extrem = maybeDeferred(self.homeserver.datastore.get_latest_event_ids_in_room, self.room_id)
|
||||||
self.assertEqual(self.successResultOf(extrem)[0], "$join:test.serv")
|
self.assertEqual(self.successResultOf(extrem)[0], "$join:test.serv")
|
||||||
|
|
||||||
@unittest.DEBUG
|
@unittest.DEBUG
|
||||||
|
@ -161,7 +161,6 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
self.http_client.post_json = post_json
|
self.http_client.post_json = post_json
|
||||||
|
|
||||||
def get_json(destination, path, args, headers=None):
|
def get_json(destination, path, args, headers=None):
|
||||||
print(destination, path, args)
|
|
||||||
if path.startswith("/_matrix/federation/v1/state_ids/"):
|
if path.startswith("/_matrix/federation/v1/state_ids/"):
|
||||||
d = self.successResultOf(
|
d = self.successResultOf(
|
||||||
self.homeserver.datastore.get_state_ids_for_event("one:test.serv")
|
self.homeserver.datastore.get_state_ids_for_event("one:test.serv")
|
||||||
|
@ -182,7 +181,7 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
|
|
||||||
# Figure out what the most recent event is
|
# Figure out what the most recent event is
|
||||||
most_recent = self.successResultOf(
|
most_recent = self.successResultOf(
|
||||||
self.homeserver.datastore.get_latest_event_ids_in_room(self.room_id)
|
maybeDeferred(self.homeserver.datastore.get_latest_event_ids_in_room, self.room_id)
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
# Make a good event
|
# Make a good event
|
||||||
|
@ -227,7 +226,7 @@ class MessageAcceptTests(unittest.TestCase):
|
||||||
)
|
)
|
||||||
self.reactor.advance(1)
|
self.reactor.advance(1)
|
||||||
|
|
||||||
extrem = self.homeserver.datastore.get_latest_event_ids_in_room(self.room_id)
|
extrem = maybeDeferred(self.homeserver.datastore.get_latest_event_ids_in_room, self.room_id)
|
||||||
self.assertEqual(self.successResultOf(extrem)[0], "two:test.serv")
|
self.assertEqual(self.successResultOf(extrem)[0], "two:test.serv")
|
||||||
|
|
||||||
state = self.homeserver.get_state_handler().get_current_state_ids(self.room_id)
|
state = self.homeserver.get_state_handler().get_current_state_ids(self.room_id)
|
||||||
|
|
Loading…
Reference in a new issue