def test_get_posts_to_expected_url( self, mock_connection, user_context, mock_get_all_cases_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_cases_response_empty client.get("999") assert ( mock_connection.post.call_args[0][0] == "/svc/api/v2/departingemployee/get" )
def test_get_posts_expected_data_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.get("999") posted_data = mock_connection.post.call_args[1]["json"] assert mock_connection.post.call_args[0][ 0] == "v2/departingemployee/get" assert (posted_data["tenantId"] == TENANT_ID_FROM_RESPONSE and posted_data["userId"] == "999")