docstr: Test that get_channel_messages returns channel messages data.
docstr_tok: ["Test","that","get_channel_messages","returns","channel","messages","data","."]
code: def test_get_channel_messages_returns_channel_messages_data(
      self, mock_get
  ):
      """
      Test that get_channel_messages returns channel messages data.
      """
  
      # check if the group_ids parameter in the API client is set
      is_group_ids_set = (
          True if self.api_client._group_ids is not None else False
      )
  
      # configure the mocks to return a response with 'status_code' 200
      # if the group_ids parameter is not set, the mocks will return the group data first, then the channel ID data, then the channel messages data
      if not is_group_ids_set:
          mock_get.side_effect = [
              Mock(
                  status_code=200,
                  headers={"Content-Type": "application/json"},
                  json=Mock(
                      return_value=ms_teams_handler_config.TEST_GROUP_DATA
                  ),
              ),
              Mock(
                  status_code=200,
                  headers={"Content-Type": "application/json"},
                  json=Mock(
                      return_value=ms_teams_handler_config.TEST_CHANNEL_ID_DATA
                  ),
              ),
              Mock(
                  status_code=200,
                  headers={"Content-Type": "application/json"},
                  json=Mock(
                      return_value={
                          "value": ms_teams_handler_config.TEST_CHANNEL_MESSAGES_DATA
                      }
                  ),
              ),
          ]
  
      # if the group_ids parameter is set, the mocks will only return the channel ID data, then the channel messages data
      else:
          mock_get.side_effect = [
              Mock(
                  status_code=200,
                  headers={"Content-Type": "application/json"},
                  json=Mock(
                      return_value=ms_teams_handler_config.TEST_CHANNEL_ID_DATA
                  ),
              ),
              Mock(
                  status_code=200,
                  headers={"Content-Type": "application/json"},
                  json=Mock(
                      return_value={
                          "value": ms_teams_handler_config.TEST_CHANNEL_MESSAGES_DATA
                      }
                  ),
              ),
          ]
  
      channel_messages_data = self.api_client.get_channel_messages()
  
      # assert the requests.get calls were made with the expected arguments
      # if the group_ids parameter is not set, check the calls to the groups endpoint
      if not is_group_ids_set:
          mock_get.assert_any_call(
              "https://graph.microsoft.com/v1.0/groups/",
              headers={"Authorization": "Bearer test_access_token"},
              params={"$select": "id,resourceProvisioningOptions"},
          )
  
      mock_get.assert_any_call(
          "https://graph.microsoft.com/v1.0/teams/test_team_id/channels/",
          headers={"Authorization": "Bearer test_access_token"},
          params=None,
      )
  
      mock_get.assert_any_call(
          "https://graph.microsoft.com/v1.0/teams/test_team_id/channels/test_channel_id/messages/",
          headers={"Authorization": "Bearer test_access_token"},
          params={"$top": 20},
      )
  
      self.assertEqual(channel_messages_data[0]["id"], "test_id")
      self.assertEqual(
          channel_messages_data[0]["messageType"], "message"
      )
      self.assertEqual(
          channel_messages_data[0]["channelIdentity"]["channelId"],
          "test_channel_id",
      )
      self.assertEqual(
          channel_messages_data[0]["channelIdentity"]["teamId"],
          "test_team_id",
      )
  
imports: import unittest
  from unittest.mock import Mock, patch
  from mindsdb_sql.parser import ast
  from mindsdb_sql.parser.ast import Constant, BinaryOperation
  from mindsdb_sql.parser.ast.select.star import Star
  from mindsdb_sql.parser.ast.select.identifier import Identifier
  from mindsdb.integrations.handlers.ms_teams_handler.ms_teams_handler import MSTeamsHandler
  from mindsdb.integrations.handlers.ms_teams_handler.settings import ms_teams_handler_config
  from mindsdb.integrations.handlers.ms_teams_handler.ms_graph_api_teams_client import MSGraphAPITeamsClient
  from mindsdb.integrations.handlers.ms_teams_handler.ms_teams_tables import ChatsTable, ChatMessagesTable, ChannelsTable, ChannelMessagesTable
label_desc: Use image node_id 11 for calling the TestMSGraphAPITeamsClient obj's underlying member method code with example usage: obj.test_get_channel_messages_returns_channel_messages_data(mock_get) without return types