Remove obsolete RoomEventsStoreTestCase (#13200)
All tests are prefixed with `STALE_` and therefore they are silently
skipped. They were moved to `STALE_` in version `v0.5.0` in commit
2fcce3b3c5
- `Remove stale tests`.
Tests from `RoomEventsStoreTestCase` class are not used for last 8
years, I believe the best would be to remove them entirely.
Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
This commit is contained in:
parent
1391a76cd2
commit
bb20113c8f
|
@ -0,0 +1 @@
|
|||
Remove obsolete and for 8 years unused `RoomEventsStoreTestCase`. Contributed by @arkamar.
|
|
@ -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
|
||||
|
||||
|
@ -65,71 +64,3 @@ class RoomStoreTestCase(HomeserverTestCase):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue