code: def test_text_environment_setup(self):
      env = TextEnvironment(
          self.gpt2_model,
          self.gpt2_tokenizer,
          tools=[DummyTool()],
          reward_fn=lambda x: torch.tensor(1),
          prompt="I am a prompt!\n",
      )
      self.assertEqual(env.prompt, "I am a prompt!\n")
      self.assertEqual(list(env.tools.keys()), ["DummyTool"])
      self.assertTrue(isinstance(env.tools["DummyTool"], DummyTool))
      self.assertEqual(env.reward_fn("Hello there!"), 1)
  
imports: import unittest
  from unittest.mock import patch
  import torch
  from transformers import AutoTokenizer
  from trl import AutoModelForCausalLMWithValueHead, TextEnvironment, TextHistory
label_desc: Use image node_id 2 for calling the TextEnvironmentTester obj's underlying member method code with example usage: obj.test_text_environment_setup() without return types