mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fix tests
This commit is contained in:
parent
073173277c
commit
e79ba9eb34
@ -18,7 +18,7 @@ from mock import Mock
|
|||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership, RoomVersions
|
||||||
from synapse.types import RoomID, UserID
|
from synapse.types import RoomID, UserID
|
||||||
|
|
||||||
from tests import unittest
|
from tests import unittest
|
||||||
@ -52,6 +52,7 @@ class RedactionTestCase(unittest.TestCase):
|
|||||||
content = {"membership": membership}
|
content = {"membership": membership}
|
||||||
content.update(extra_content)
|
content.update(extra_content)
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": EventTypes.Member,
|
"type": EventTypes.Member,
|
||||||
"sender": user.to_string(),
|
"sender": user.to_string(),
|
||||||
@ -74,6 +75,7 @@ class RedactionTestCase(unittest.TestCase):
|
|||||||
self.depth += 1
|
self.depth += 1
|
||||||
|
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": EventTypes.Message,
|
"type": EventTypes.Message,
|
||||||
"sender": user.to_string(),
|
"sender": user.to_string(),
|
||||||
@ -94,6 +96,7 @@ class RedactionTestCase(unittest.TestCase):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def inject_redaction(self, room, event_id, user, reason):
|
def inject_redaction(self, room, event_id, user, reason):
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": EventTypes.Redaction,
|
"type": EventTypes.Redaction,
|
||||||
"sender": user.to_string(),
|
"sender": user.to_string(),
|
||||||
|
@ -18,7 +18,7 @@ from mock import Mock
|
|||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership, RoomVersions
|
||||||
from synapse.types import RoomID, UserID
|
from synapse.types import RoomID, UserID
|
||||||
|
|
||||||
from tests import unittest
|
from tests import unittest
|
||||||
@ -50,6 +50,7 @@ class RoomMemberStoreTestCase(unittest.TestCase):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def inject_room_member(self, room, user, membership, replaces_state=None):
|
def inject_room_member(self, room, user, membership, replaces_state=None):
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": EventTypes.Member,
|
"type": EventTypes.Member,
|
||||||
"sender": user.to_string(),
|
"sender": user.to_string(),
|
||||||
|
@ -17,7 +17,7 @@ import logging
|
|||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership, RoomVersions
|
||||||
from synapse.storage.state import StateFilter
|
from synapse.storage.state import StateFilter
|
||||||
from synapse.types import RoomID, UserID
|
from synapse.types import RoomID, UserID
|
||||||
|
|
||||||
@ -52,6 +52,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def inject_state_event(self, room, sender, typ, state_key, content):
|
def inject_state_event(self, room, sender, typ, state_key, content):
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": typ,
|
"type": typ,
|
||||||
"sender": sender.to_string(),
|
"sender": sender.to_string(),
|
||||||
|
@ -17,6 +17,7 @@ import logging
|
|||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.defer import succeed
|
from twisted.internet.defer import succeed
|
||||||
|
|
||||||
|
from synapse.api.constants import RoomVersions
|
||||||
from synapse.events import FrozenEvent
|
from synapse.events import FrozenEvent
|
||||||
from synapse.visibility import filter_events_for_server
|
from synapse.visibility import filter_events_for_server
|
||||||
|
|
||||||
@ -124,6 +125,7 @@ class FilterEventsForServerTestCase(tests.unittest.TestCase):
|
|||||||
def inject_visibility(self, user_id, visibility):
|
def inject_visibility(self, user_id, visibility):
|
||||||
content = {"history_visibility": visibility}
|
content = {"history_visibility": visibility}
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": "m.room.history_visibility",
|
"type": "m.room.history_visibility",
|
||||||
"sender": user_id,
|
"sender": user_id,
|
||||||
@ -144,6 +146,7 @@ class FilterEventsForServerTestCase(tests.unittest.TestCase):
|
|||||||
content = {"membership": membership}
|
content = {"membership": membership}
|
||||||
content.update(extra_content)
|
content.update(extra_content)
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": "m.room.member",
|
"type": "m.room.member",
|
||||||
"sender": user_id,
|
"sender": user_id,
|
||||||
@ -165,6 +168,7 @@ class FilterEventsForServerTestCase(tests.unittest.TestCase):
|
|||||||
if content is None:
|
if content is None:
|
||||||
content = {"body": "testytest"}
|
content = {"body": "testytest"}
|
||||||
builder = self.event_builder_factory.new(
|
builder = self.event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": "m.room.message",
|
"type": "m.room.message",
|
||||||
"sender": user_id,
|
"sender": user_id,
|
||||||
|
@ -26,7 +26,7 @@ from six.moves.urllib import parse as urlparse
|
|||||||
|
|
||||||
from twisted.internet import defer, reactor
|
from twisted.internet import defer, reactor
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes, RoomVersions
|
||||||
from synapse.api.errors import CodeMessageException, cs_error
|
from synapse.api.errors import CodeMessageException, cs_error
|
||||||
from synapse.config.server import ServerConfig
|
from synapse.config.server import ServerConfig
|
||||||
from synapse.federation.transport import server
|
from synapse.federation.transport import server
|
||||||
@ -622,6 +622,7 @@ def create_room(hs, room_id, creator_id):
|
|||||||
event_creation_handler = hs.get_event_creation_handler()
|
event_creation_handler = hs.get_event_creation_handler()
|
||||||
|
|
||||||
builder = event_builder_factory.new(
|
builder = event_builder_factory.new(
|
||||||
|
RoomVersions.V1,
|
||||||
{
|
{
|
||||||
"type": EventTypes.Create,
|
"type": EventTypes.Create,
|
||||||
"state_key": "",
|
"state_key": "",
|
||||||
|
Loading…
Reference in New Issue
Block a user