class_docstr: Tests for chat service agent functionality.
docstr: Test to make sure that assigning the `data` attribute of a MessengerAgent does
  not overwrite values already in `data`.
docstr_tok: ["Test","to","make","sure","that","assigning","the","`","data","`","attribute","of","a","MessengerAgent","does","not","overwrite","values","already","in","`","data","`","."]
code: def test_data_persistence(self):
      """
      Test to make sure that assigning the `data` attribute of a MessengerAgent does
      not overwrite values already in `data`.
      """
      opt = self._get_args()
      opt.update(OPT)
      manager = MessengerManager(opt)
      agent = MessengerAgent(opt, manager, AGENT_ID, TASK_ID, PAGE_ID)
  
      self.assertEqual(agent.data, {"allow_images": False})
      agent.data = {"second_arg": False}
      self.assertEqual(
          agent.data, {"allow_images": False, "second_arg": False}
      )
      agent.data["allow_images"] = True
      self.assertEqual(
          agent.data, {"allow_images": True, "second_arg": False}
      ),
      agent.data = {"third_arg": 1, "second_arg": True}
      self.assertEqual(
          agent.data,
          {"allow_images": True, "second_arg": True, "third_arg": 1},
      )
  
file_path: ParlAI/tests/test_chat_service.py
imports: import unittest
  from parlai.chat_service.utils.config import WorldConfig
  from parlai.chat_service.services.messenger.agents import MessengerAgent
  from parlai.chat_service.services.messenger.messenger_manager import MessengerManager
  from parlai.core.params import ParlaiParser
label_desc: Use image node_id 2 for calling the TestChatServiceAgent obj's underlying member method code with example usage: obj.test_data_persistence() without return types