Collect room-version variations into one place (#4969)

Collect all the things that make room-versions different to one another into
one place, so that it's easier to define new room versions.
This commit is contained in:
Richard van der Hoff 2019-04-01 10:24:38 +01:00 committed by GitHub
parent 215c15d049
commit 54a87a7b08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 222 additions and 168 deletions

View file

@ -16,8 +16,8 @@
import unittest
from synapse import event_auth
from synapse.api.constants import RoomVersions
from synapse.api.errors import AuthError
from synapse.api.room_versions import RoomVersions
from synapse.events import FrozenEvent
@ -37,7 +37,7 @@ class EventAuthTestCase(unittest.TestCase):
# creator should be able to send state
event_auth.check(
RoomVersions.V1, _random_state_event(creator), auth_events,
RoomVersions.V1.identifier, _random_state_event(creator), auth_events,
do_sig_check=False,
)
@ -45,7 +45,7 @@ class EventAuthTestCase(unittest.TestCase):
self.assertRaises(
AuthError,
event_auth.check,
RoomVersions.V1,
RoomVersions.V1.identifier,
_random_state_event(joiner),
auth_events,
do_sig_check=False,
@ -74,7 +74,7 @@ class EventAuthTestCase(unittest.TestCase):
self.assertRaises(
AuthError,
event_auth.check,
RoomVersions.V1,
RoomVersions.V1.identifier,
_random_state_event(pleb),
auth_events,
do_sig_check=False,
@ -82,7 +82,7 @@ class EventAuthTestCase(unittest.TestCase):
# king should be able to send state
event_auth.check(
RoomVersions.V1, _random_state_event(king), auth_events,
RoomVersions.V1.identifier, _random_state_event(king), auth_events,
do_sig_check=False,
)