Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions tests/zoomus/components/meeting/test_delete_registrant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import datetime
import unittest

from zoomus import components, util
import responses


def suite():
"""Define all the tests of the module."""
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(DeleteRegistrantV2TestCase))
return suite


class DeleteRegistrantV2TestCase(unittest.TestCase):
def setUp(self):
self.component = components.meeting.MeetingComponentV2(
base_uri="http://foo.com",
config={
"api_key": "KEY",
"api_secret": "SECRET",
"version": util.API_VERSION_2,
},
)

@responses.activate
def test_can_delete_registrant(self):
responses.add(
responses.DELETE,
"http://foo.com/meetings/ID/registrants/REGISTRANT_ID",
)
self.component.delete_registrant(
id="ID", registrant_id ="REGISTRANT_ID"
)

def test_requires_meeting_id(self):
with self.assertRaisesRegexp(ValueError, "'id' must be set"):
self.component.delete_registrant()

def test_requires_registrant_id(self):
with self.assertRaisesRegexp(ValueError, "'registrant_id' must be set"):
self.component.delete_registrant()


if __name__ == "__main__":
unittest.main()
6 changes: 6 additions & 0 deletions zoomus/components/meeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ def add_registrant(self, **kwargs):
"/meetings/{}/registrants".format(kwargs.get("id")), data=kwargs
)

def delete_registrant(self, **kwargs):
util.require_keys(kwargs, ["id", "registrant_id"])
return self.delete_request(
"/meetings/{}/registrants/{}".format(kwargs.get("id"), kwargs.get("registrant_id")), data=kwargs
)

def list_registrants(self, **kwargs):
util.require_keys(kwargs, "id")
return self.get_request(
Expand Down