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

Commit 27d8298

Browse files
committed
Add room create with initial state test
1 parent fd9b836 commit 27d8298

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/rest/client/test_rooms.py

+13
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,19 @@ def test_post_room_no_keys(self) -> None:
711711
assert channel.resource_usage is not None
712712
self.assertEqual(33, channel.resource_usage.db_txn_count)
713713

714+
def test_post_room_initial_state(self) -> None:
715+
# POST with initial_state config key, expect new room id
716+
channel = self.make_request(
717+
"POST",
718+
"/createRoom",
719+
b'{"initial_state":[{"type": "m.bridge", "content": {}}]}',
720+
)
721+
722+
self.assertEqual(200, channel.code, channel.result)
723+
self.assertTrue("room_id" in channel.json_body)
724+
assert channel.resource_usage is not None
725+
self.assertEqual(37, channel.resource_usage.db_txn_count)
726+
714727
def test_post_room_visibility_key(self) -> None:
715728
# POST with visibility config key, expect new room id
716729
channel = self.make_request("POST", "/createRoom", b'{"visibility":"private"}')

0 commit comments

Comments
 (0)