docstr: Tests batch_act() of Repeat Query agent.
docstr_tok: ["Tests","batch_act","(",")","of","Repeat","Query","agent","."]
code: def test_batch_act(self):
      """
      Tests batch_act() of Repeat Query agent.
      """
      agent = create_agent(dict(model="repeat_query"))
      observations = []
      batch_reply = agent.batch_act(observations)
      self.assertEqual(len(batch_reply), 0)
      observations = [
          Message({"text": "hello!", "episode_done": False}),
          Message({"text": "", "episode_done": False}),
          Message({"episode_done": False}),
          Message(),
          None,
      ]
      original_obs = "Hey there!"
      agent.observe(original_obs)
      self.assertEqual(agent.observation, original_obs)
      batch_reply = agent.batch_act(observations)
      # Make sure original observation doesn't change.
      self.assertEqual(agent.observation, original_obs)
      self.assertEqual(len(batch_reply[0]), 3)
      self.assertEqual(batch_reply[0]["text"], "hello!")
      self.assertEqual(batch_reply[0]["episode_done"], False)
      self.assertEqual(batch_reply[0]["id"], "RepeatQueryAgent")
      self.assertEqual(len(batch_reply[1]), 3)
      self.assertEqual(batch_reply[1]["text"], "Nothing to repeat yet.")
      self.assertEqual(batch_reply[1]["episode_done"], False)
      self.assertEqual(batch_reply[1]["id"], "RepeatQueryAgent")
      self.assertEqual(len(batch_reply[2]), 3)
      self.assertEqual(batch_reply[2]["text"], "I don't know")
      self.assertEqual(batch_reply[2]["episode_done"], False)
      self.assertEqual(batch_reply[2]["id"], "RepeatQueryAgent")
      self.assertEqual(len(batch_reply[3]), 3)
      self.assertEqual(batch_reply[3]["text"], "I don't know")
      self.assertEqual(batch_reply[3]["episode_done"], False)
      self.assertEqual(batch_reply[3]["id"], "RepeatQueryAgent")
      self.assertEqual(len(batch_reply[4]), 2)
      self.assertEqual(batch_reply[4]["text"], "Nothing to repeat yet.")
      self.assertEqual(batch_reply[4]["episode_done"], False)
  
file_path: ParlAI/tests/test_repeat_query_agent.py
imports: import unittest
  from parlai.core.agents import create_agent
  from parlai.core.message import Message
label_desc: Use image node_id 4 for calling the TestRepeatQueryAgent obj's underlying member method code with example usage: obj.test_batch_act() without return types