mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-28 05:04:38 +00:00
Use immutabledict instead of frozendict (#15113)
Additionally: * Consistently use `freeze()` in test --------- Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
co-authored by
Patrick Cloke
6543
parent
cabe4a3005
commit
3b0083c92a
@@ -18,7 +18,6 @@ from typing import List
|
||||
from unittest.mock import patch
|
||||
|
||||
import jsonschema
|
||||
from frozendict import frozendict
|
||||
|
||||
from twisted.test.proto_helpers import MemoryReactor
|
||||
|
||||
@@ -29,6 +28,7 @@ from synapse.api.presence import UserPresenceState
|
||||
from synapse.server import HomeServer
|
||||
from synapse.types import JsonDict
|
||||
from synapse.util import Clock
|
||||
from synapse.util.frozenutils import freeze
|
||||
|
||||
from tests import unittest
|
||||
from tests.events.test_utils import MockEvent
|
||||
@@ -343,12 +343,12 @@ class FilteringTestCase(unittest.HomeserverTestCase):
|
||||
|
||||
self.assertFalse(Filter(self.hs, definition)._check(event))
|
||||
|
||||
# check it works with frozendicts too
|
||||
# check it works with frozen dictionaries too
|
||||
event = MockEvent(
|
||||
sender="@foo:bar",
|
||||
type="m.room.message",
|
||||
room_id="!secretbase:unknown",
|
||||
content=frozendict({EventContentFields.LABELS: ["#fun"]}),
|
||||
content=freeze({EventContentFields.LABELS: ["#fun"]}),
|
||||
)
|
||||
self.assertTrue(Filter(self.hs, definition)._check(event))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user