def test_set_alerts_enabled_posts_to_expected_url( self, mock_connection, user_context, mock_get_all_response_empty, mock_detection_list_user_client, ): client = DepartingEmployeeService(mock_connection, user_context, mock_detection_list_user_client) mock_connection.post.return_value = mock_get_all_response_empty client.set_alerts_enabled() assert (mock_connection.post.call_args[0][0] == "v2/departingemployee/setalertstate")
def test_set_alerts_enabled_posts_expected_data( self, mock_connection, user_context, mock_get_all_response_empty, mock_detection_list_user_client, ): client = DepartingEmployeeService(mock_connection, user_context, mock_detection_list_user_client) mock_connection.post.return_value = mock_get_all_response_empty client.set_alerts_enabled() posted_data = mock_connection.post.call_args[1]["json"] assert (posted_data["tenantId"] == TENANT_ID_FROM_RESPONSE and posted_data["alertsEnabled"] is True)