Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_can_require_keys_with_single_string_key(self):
d = {"a": 1}
with self.assertRaises(ValueError) as context:
util.require_keys(d, "b")
self.assertEqual(context.exception.message, "'b' must be set")
def get_user_report(self, **kwargs):
util.require_keys(kwargs, ["user_id", "start_time", "end_time"])
kwargs["from"] = util.date_to_str(kwargs["start_time"])
del kwargs["start_time"]
kwargs["to"] = util.date_to_str(kwargs["end_time"])
del kwargs["end_time"]
return self.get_request(
"/report/users/{}/meetings".format(kwargs.get("user_id")), params=kwargs
)
def list(self, **kwargs):
util.require_keys(kwargs, "user_id")
start = kwargs.pop("start", None)
if start:
kwargs["from"] = util.date_to_str(start)
end = kwargs.pop("end", None)
if end:
kwargs["to"] = util.date_to_str(end)
return self.get_request(
"/users/{}/recordings".format(kwargs.get("user_id")), params=kwargs
)
def get(self, **kwargs):
util.require_keys(kwargs, ["meeting_id"])
return self.post_request("/recording/get", params=kwargs)
def end(self, **kwargs):
util.require_keys(kwargs, ["id", "host_id"])
return self.post_request("/webinar/end", params=kwargs)
def list(self, **kwargs):
util.require_keys(kwargs, "host_id")
if kwargs.get("start_time"):
kwargs["start_time"] = util.date_to_str(kwargs["start_time"])
return self.post_request("/webinar/list", params=kwargs)
def delete(self, **kwargs):
util.require_keys(kwargs, "id")
return self.post_request("/user/delete", params=kwargs)
def end(self, **kwargs):
util.require_keys(kwargs, ["id", "host_id"])
return self.post_request("/meeting/end", params=kwargs)
def update(self, **kwargs):
util.require_keys(kwargs, "id")
return self.post_request("/user/update", params=kwargs)
def cust_create(self, **kwargs):
util.require_keys(kwargs, ["type", "email"])
return self.post_request("/user/custcreate", params=kwargs)