mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 01:02:10 -04:00
Merge PDUs and Events into one object
This commit is contained in:
parent
8c2b5ea7c4
commit
cb4b6c844a
10 changed files with 91 additions and 212 deletions
|
@ -23,7 +23,7 @@ from ..utils import MockHttpResource, MockClock, MockKey
|
|||
|
||||
from synapse.server import HomeServer
|
||||
from synapse.federation import initialize_http_replication
|
||||
from synapse.federation.units import Pdu
|
||||
from synapse.api.events import SynapseEvent
|
||||
|
||||
|
||||
def make_pdu(prev_pdus=[], **kwargs):
|
||||
|
@ -40,7 +40,7 @@ def make_pdu(prev_pdus=[], **kwargs):
|
|||
}
|
||||
pdu_fields.update(kwargs)
|
||||
|
||||
return Pdu(prev_pdus=prev_pdus, **pdu_fields)
|
||||
return SynapseEvent(prev_pdus=prev_pdus, **pdu_fields)
|
||||
|
||||
|
||||
class FederationTestCase(unittest.TestCase):
|
||||
|
@ -169,7 +169,7 @@ class FederationTestCase(unittest.TestCase):
|
|||
(200, "OK")
|
||||
)
|
||||
|
||||
pdu = Pdu(
|
||||
pdu = SynapseEvent(
|
||||
event_id="abc123def456",
|
||||
origin="red",
|
||||
room_id="my-context",
|
||||
|
@ -189,7 +189,7 @@ class FederationTestCase(unittest.TestCase):
|
|||
"origin_server_ts": 1000000,
|
||||
"origin": "test",
|
||||
"pdus": [
|
||||
pdu.get_dict(),
|
||||
pdu.get_pdu_json(),
|
||||
],
|
||||
'pdu_failures': [],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue