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_init_sets_config(self):
client = ZoomClient("KEY", "SECRET")
self.assertEqual(
client.config,
{
"api_key": "KEY",
"api_secret": "SECRET",
"data_type": "json",
"token": util.generate_jwt("KEY", "SECRET"),
"version": util.API_VERSION_2,
},
def test_can_get_user_component(self):
client = ZoomClient("KEY", "SECRET")
self.assertIsInstance(client.user, components.user.UserComponentV2)
def test_can_use_client_with_context(self):
with ZoomClient("KEY", "SECRET") as client:
self.assertIsInstance(client, ZoomClient)
def test_refresh_token_replaces_config_token_with_new_jwt(self, mock_jwt):
client = ZoomClient("KEY", "SECRET")
client.refresh_token()
mock_jwt.assert_called_with("KEY", "SECRET")
self.assertEqual(client.config["token"], (mock_jwt.return_value,))
def test_can_get_report_component(self):
client = ZoomClient("KEY", "SECRET")
self.assertIsInstance(client.report, components.report.ReportComponentV2)
def test_init_creates_all_components(self):
client = ZoomClient("KEY", "SECRET")
self.assertEqual(
set(
[
"meeting",
"metric",
"past_meeting",
"phone",
"recording",
"report",
"user",
"webinar",
]
),
set(client.components.keys()),
)
self.assertIsInstance(
def test_cannot_init_with_non_int_timeout(self):
with self.assertRaises(ValueError) as context:
ZoomClient("KEY", "SECRET", timeout="bad")
self.assertEqual(
context.exception.message, "timeout value must be an integer"
)
def test_can_get_recording_component(self):
client = ZoomClient("KEY", "SECRET")
self.assertIsInstance(
client.recording, components.recording.RecordingComponentV2
)
def test_can_get_api_key(self):
client = ZoomClient("KEY", "SECRET")
self.assertEqual(client.api_key, "KEY")
def test_can_set_api_secret(self):
client = ZoomClient("KEY", "SECRET")
client.api_secret = "NEW-SECRET"
self.assertEqual(client.api_secret, "NEW-SECRET")