compose: Verify request payload in Zoom meeting creation test

Verify that Zoom meeting creation logic sends the expected request payload for
configuring host_video and participant video.
This commit is contained in:
Danny Su 2023-08-29 00:00:59 -07:00 committed by Tim Abbott
parent 66b9c06de6
commit 2414ddd2d4
1 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,6 @@
from unittest import mock
import orjson
import responses
from django.core.signing import Signer
from django.http import HttpResponseRedirect
@ -67,6 +68,15 @@ class TestVideoCall(ZulipTestCase):
responses.calls[-1].request.url,
"https://api.zoom.us/v2/users/me/meetings",
)
self.assertEqual(
orjson.loads(responses.calls[-1].request.body),
{
"settings": {
"host_video": True,
"participant_video": True,
},
},
)
self.assertEqual(
responses.calls[-1].request.headers["Authorization"],
"Bearer newtoken",
@ -92,6 +102,15 @@ class TestVideoCall(ZulipTestCase):
responses.calls[-1].request.url,
"https://api.zoom.us/v2/users/me/meetings",
)
self.assertEqual(
orjson.loads(responses.calls[-1].request.body),
{
"settings": {
"host_video": False,
"participant_video": False,
},
},
)
self.assertEqual(
responses.calls[-1].request.headers["Authorization"],
"Bearer newtoken",