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:
David Robertson
2023-03-22 17:15:34 +00:00
committed by GitHub
co-authored by Patrick Cloke 6543
parent cabe4a3005
commit 3b0083c92a
20 changed files with 123 additions and 243 deletions
+3 -3
View File
@@ -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))