diff options
author | AndrewFerr <AndrewFerr@users.noreply.github.com> | 2021-10-04 10:43:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 14:43:03 +0000 |
commit | 30f02404017231ed7e84667f3e1b85e2ed1ae348 (patch) | |
tree | 4ceffe0770b1fcf76f174a9baab6190b682ed3b5 /tests/rest/client/utils.py | |
parent | Merge tag 'v1.44.0rc3' into develop (diff) | |
download | synapse-30f02404017231ed7e84667f3e1b85e2ed1ae348.tar.xz |
Make is_public Optional[bool] for create_room_as test util (#10951) (#10963)
Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
Diffstat (limited to '')
-rw-r--r-- | tests/rest/client/utils.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/rest/client/utils.py b/tests/rest/client/utils.py index 3075d3f288..71fa87ce92 100644 --- a/tests/rest/client/utils.py +++ b/tests/rest/client/utils.py @@ -48,7 +48,7 @@ class RestHelper: def create_room_as( self, room_creator: Optional[str] = None, - is_public: bool = True, + is_public: Optional[bool] = None, room_version: Optional[str] = None, tok: Optional[str] = None, expect_code: int = 200, @@ -62,9 +62,10 @@ class RestHelper: Args: room_creator: The user ID to create the room with. - is_public: If True, the `visibility` parameter will be set to the - default (public). Otherwise, the `visibility` parameter will be set - to "private". + is_public: If True, the `visibility` parameter will be set to + "public". If False, it will be set to "private". If left + unspecified, the server will set it to an appropriate default + (which should be "private" as per the CS spec). room_version: The room version to create the room as. Defaults to Synapse's default room version. tok: The access token to use in the request. @@ -77,8 +78,8 @@ class RestHelper: self.auth_user_id = room_creator path = "/_matrix/client/r0/createRoom" content = extra_content or {} - if not is_public: - content["visibility"] = "private" + if is_public is not None: + content["visibility"] = "public" if is_public else "private" if room_version: content["room_version"] = room_version if tok: |