Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Remove obsolete RoomEventsStoreTestCase #13200

Merged
merged 3 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13200.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove obsolete and for 8 years unused `RoomEventsStoreTestCase`. Contributed by @arkamar.
69 changes: 0 additions & 69 deletions tests/storage/test_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from synapse.api.constants import EventTypes
from synapse.api.room_versions import RoomVersions
from synapse.types import RoomAlias, RoomID, UserID

Expand Down Expand Up @@ -65,71 +64,3 @@ def test_get_room_with_stats_unknown_room(self):
self.assertIsNone(
(self.get_success(self.store.get_room_with_stats("!uknown:test"))),
)


class RoomEventsStoreTestCase(HomeserverTestCase):
def prepare(self, reactor, clock, hs):
# Room events need the full datastore, for persist_event() and
# get_room_state()
self.store = hs.get_datastores().main
self._storage_controllers = hs.get_storage_controllers()
self.event_factory = hs.get_event_factory()

self.room = RoomID.from_string("!abcde:test")

self.get_success(
self.store.store_room(
self.room.to_string(),
room_creator_user_id="@creator:text",
is_public=True,
room_version=RoomVersions.V1,
)
)

def inject_room_event(self, **kwargs):
self.get_success(
self._storage_controllers.persistence.persist_event(
self.event_factory.create_event(room_id=self.room.to_string(), **kwargs)
)
)

def STALE_test_room_name(self):
name = "A-Room-Name"

self.inject_room_event(
etype=EventTypes.Name, name=name, content={"name": name}, depth=1
)

state = self.get_success(
self._storage_controllers.state.get_current_state(
room_id=self.room.to_string()
)
)

self.assertEqual(1, len(state))
self.assertObjectHasAttributes(
{"type": "m.room.name", "room_id": self.room.to_string(), "name": name},
state[0],
)

def STALE_test_room_topic(self):
topic = "A place for things"

self.inject_room_event(
etype=EventTypes.Topic, topic=topic, content={"topic": topic}, depth=1
)

state = self.get_success(
self._storage_controllers.state.get_current_state(
room_id=self.room.to_string()
)
)

self.assertEqual(1, len(state))
self.assertObjectHasAttributes(
{"type": "m.room.topic", "room_id": self.room.to_string(), "topic": topic},
state[0],
)

# Not testing the various 'level' methods for now because there's lots
# of them and need coalescing; see JIRA SPEC-11