mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
zerver: API to create channel.
Fixes #16206. Co-authored-by: Sahil Batra <sahil@zulip.com> Co-authored-by: Steve Howell <showell@zulip.com> Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
6ef2591b47
commit
6203861529
@@ -1904,6 +1904,20 @@ def update_user_group_members(client: Client, user_group_id: int) -> None:
|
||||
validate_against_openapi_schema(result, "/user_groups/{group_id}/members", "post", "200")
|
||||
|
||||
|
||||
@openapi_test_function("/channels/create:post")
|
||||
def add_channel(client: Client) -> None:
|
||||
# {code_example|start}
|
||||
request = {
|
||||
"name": "music_group",
|
||||
"description": "Channel for discussing and learning about music.",
|
||||
"subscribers": [],
|
||||
}
|
||||
result = client.call_endpoint(url="channels/create", method="POST", request=request)
|
||||
# {code_example|end}
|
||||
assert_success_response(result)
|
||||
validate_against_openapi_schema(result, "/channels/create", "post", "200")
|
||||
|
||||
|
||||
def test_invalid_api_key(client_with_invalid_key: Client) -> None:
|
||||
result = client_with_invalid_key.get_subscriptions()
|
||||
assert_error_response(result, code="UNAUTHORIZED")
|
||||
@@ -2020,6 +2034,7 @@ def test_users(client: Client, owner_client: Client) -> None:
|
||||
|
||||
def test_streams(client: Client, nonadmin_client: Client) -> None:
|
||||
add_subscriptions(client)
|
||||
add_channel(client)
|
||||
test_add_subscriptions_already_subscribed(client)
|
||||
get_subscriptions(client)
|
||||
stream_id = get_stream_id(client)
|
||||
|
||||
Reference in New Issue
Block a user